Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image in the clipboard to disk?
Message
From
29/08/2008 10:34:09
 
 
To
29/08/2008 10:28:23
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01343003
Message ID:
01343121
Views:
17
Yes, you're right, sorry about that. Here it is. Actually it's just a wrapper function for Adir() since i have found that fsize() is not always reliable.
Function filesize
   Lparameters lcFileName
   Local lnReturn,lnAsize
   Local Array laDummy(1)
   lnReturn=0
   lnAsize=Adir(laDummy,lcFileName)
   Do Case
      Case lnAsize=1 && Only one match, our goal
         lnReturn=laDummy(2)
      Case lnAsize=0 && No match
         lnReturn=0
      Otherwise     && More than one match
         lnReturn=-1
   Endcase
Return lnReturn
>Hi Tore,
>I needed something like this as well, so I tried but it gives me error
>on this line which is perhaps call to a function you forgot to include;
>
>
>**errors here
>Return filesize(cFilename)>0
>
>
>Can you post code of this filesize() fnction as well ?
>
>TIA
>Sergio
>
>
>
>
>>>I want to have a button on a form take the png image in the clipboard (put there by snagit) and bring up the filer dialog (getfile()) and save it
>>>
>>>Is this possible?
>>>
>>>or could i just automate snagit to let me grab and save (as Rick does in wwHlp) any pointers how to do this?
>>>
>>>
>>>peter
>>
>>
>>Function saveclipasjpg
>>   Lparameters cFilename
>>   Local llReturn, GDIP, img
>>   If Pcount()=0 Or Vartype(cFilename)#'C'
>>      cFilename="ClipImage"
>>   Endif
>>   cFilename=Forceext(cFilename,'jpg')
>>   Erase (cFilename)
>>   If clipIsImage() &&Len(_cliptext)=0
>>      #include gpimage.h
>>      If Not "GPIMAGE" $ Set("Procedure")
>>         Set Procedure To gpimage Additive
>>      Endif
>>      GDIP = Createobject("gpInit")
>>      img = Createobject("gpImage")
>>      img.FromClipboard()
>>      img.saveAsJpeg(cFilename)
>>*!*      Release gdip
>>*!*      Release img
>>   Endif
>>Return filesize(cFilename)>0
>>
>>Function clipIsImage
>>   #Define CF_BITMAP           2
>>   Declare short IsClipboardFormatAvailable In win32api Integer cbformat
>>Return IsClipboardFormatAvailable(CF_BITMAP)#0
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform