Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy image to Windows clipboard
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01021590
Message ID:
01024020
Views:
25
Hugo,

I gave up trying to use the VFP GDIPLUS classes to work with this image, and I went back to using your code.

It works, but not correctly. Here is the heart of my code, immitating yours:
lnHWnd			= thisform.HWnd
lnHDC			= GetDC(lnHWnd)
lnHDC_Mem		= CreateCompatibleDC(lnHDC)
lnHBitMap		= CreateCompatibleBitmap(lnHDC, This.Width, This.Height)

lnLeft			= OBJTOCLIENT(this, 2)
lnTop			= OBJTOCLIENT(this, 1)
lnWidth			= OBJTOCLIENT(this, 3)
lnHeight		= OBJTOCLIENT(this, 4)

if lnHBitMap <> 0
	lnHPrevBmp	= SelectObject(lnHDC_Mem, lnHBitMap)
	BitBlt(lnHDC_Mem, 0, 0, lnWidth, lnHeight, lnHDC, lnLeft, lnTop, SRCCOPY)
	if OpenClipboard(lnHWnd)
		EmptyClipboard()
		SetClipboardData(CF_BITMAP, lnHBitMap)
		CloseClipboard()
The problem that I am having is that I really can't get a handle to the bitmap that is in the Image control. What I do have is the entire contents of the image control. My image control is rectangular. The image displayed in it is not, so the clipboard copy I get is also rectangular, showing the image control background above and below my image.

Any suggestions?

Thanks again,
Jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform