Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pushing an image resource to clipboard
Message
From
11/11/2005 12:04:41
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Title:
Pushing an image resource to clipboard
Miscellaneous
Thread ID:
01067727
Message ID:
01067727
Views:
55
Hi all API guru

I need to push a variable string containing a graphic file (format can be png, jpeg, GIF or BMP) into windows clipboard. No VFP function here.

The current temp code works... but is clumsy (it uses Alexander Golovlev's gpImage thru a temp file temp files to push the graphic string into a file and from then into clipboard). Not clean.

Any thing smarter than the code below is welcome!

LOCAL cBitmapFile,oGDIplus,oImgResource

cBitmapFile = "mytempfile"+SUBSTR(SYS(2015),3,10)+".GIF"
STRTOFILE(MyImageBitmapString,cBitmapFile)

oGDIplus = CREATEOBJECT("gpInit")

oImgResource = CREATEOBJECT("gpImage")
oImgResource.LOAD(cBitmapFile)
oImgResource.ToClipboard()

RELEASE oImgResource

ERASE (cBitmapFile)

RETURN
Next
Reply
Map
View

Click here to load this message in the networking platform