Author | Topic: How to get an image from ClipBoard ? | |
---|---|---|
Fabio Cavallone | How to get an image from ClipBoard ? on Wed, 03 Oct 2007 15:45:53 +0200 Hi to all I'm trying to get an image from the clipboard but... i guess something is wong... Any idea? Fabio Cavallone * ---------------------------- * FUNCTION ImpClipb() * ---------------------------- * LOCAL oClipBoard, oImage, lok:=.T., aFormat oClipBoard := XbpClipBoard():new():create() oCLipBoard:Open() aFormat := oClipBoard:queryFormats() BEGIN SEQUENCE IF AScan( aFormat, XBPCLPBRD_BITMAP ) == 0 dfAlert("Sorry, No Image") BREAK ENDIF oImage := XbpBitmap():new():create() oImage:SetBuffer(oCLipBoard:GetBuffer(XBPCLPBRD_BITMAP),XBPBMP_FORMAT_JPG,50) IF oImage:SaveFile("c:\Pippo.jpg",XBPBMP_FORMAT_JPG,50) dfAlert("Image file created") ELSE dfAlert("Sorry, can't create image file") ENDIF oImage:Destroy() END SEQUENCE oClipBoard:close() oClipBoard:destroy() RETU NIL |