Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image in the clipboard to disk?
Message
From
29/08/2008 07:45:43
 
 
To
29/08/2008 07:33:06
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01343003
Message ID:
01343010
Views:
19
>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