Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Save an image from the clipboard
Message
 
À
23/09/2008 09:23:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01349799
Message ID:
01351739
Vues:
26
I have the code below but while it works on my pc it does not on the customers. They have the same version of internet explorer and are using the same version of my application that i am. When i do this i get a screen shot of the internet explorer page while they get a screen shot of the application. any ideas?
Set Procedure To gpImage Additive
Declare Long FindWindow in Win32API String ClassName, String WindowName
gdip = CreateObject("gpInit")
img = CreateObject("gpImage")
abc = findwindow("IEFrame",NULL)
img.Capture(abc)
img.SaveAsJPEG("123456")
~M

>Requires GPIMAGE, http://gpimage2.googlepages.com/
>
>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
>*************************************************************************************************
>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 all,
>>I have an image ont he clipboard, i can go into paint and paste it in there, but what i want to do is have a button on the form and save the image as a predetermined file name, is this possible?
>>~M
Go raibh maith agat

~M
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform