Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Image in the clipboard to disk?
Message
De
29/08/2008 07:45:43
 
 
À
29/08/2008 07:33:06
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01343003
Message ID:
01343010
Vues:
20
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform