Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy image to Windows clipboard
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
01021590
Message ID:
01024020
Vues:
26
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform