Hi everybody!
I have a code that copy an image on my form to clipboard using gdiplus.
I make something like this
As you can see I pass through the LoadImage function to get a working handle of the image since I tried loImage.handle, loImage.gethandle(), loImage.streamprt without any result, SetClipboardData is working only with hBitmap.
Is there a way to avoid using LoadImage and getting a working handle from loImage?
Maybe is easy but unfortunatly I'm not expert in clipboard and gdiplus.
Thank you!
I have a code that copy an image on my form to clipboard using gdiplus.
I make something like this
Code:
#Define CF_BITMAP 2
Declare Long LoadImage in User32;
Long hInst, String cFilename, Integer nType, ;
Integer cxDesired, Integer cyDesired, Integer fuLoad
loImage = _SCREEN.System.Drawing.Bitmap.fromvarbinary(this.image.PictureVal)
loImage.Save("c:\img.bmp", _SCREEN.System.Drawing.Imaging.ImageFormat.Bmp)
hBitmap = LoadImage(0, "c:\img.bmp", 0, 0,0, 0x10)
IF (OpenClipboard(0) <> 0)
EmptyClipboard()
SetClipboardData(CF_BITMAP,hBitmap)
closeclipboard()
ENDIF
As you can see I pass through the LoadImage function to get a working handle of the image since I tried loImage.handle, loImage.gethandle(), loImage.streamprt without any result, SetClipboardData is working only with hBitmap.
Is there a way to avoid using LoadImage and getting a working handle from loImage?
Maybe is easy but unfortunatly I'm not expert in clipboard and gdiplus.
Thank you!