Hi
How to use the Windows API BitBlt function in conjunction with an WD Image control. What I want to archieve is to copy f.e. a button, as bitmap into an imagecontrol.
Q : How to use BitBlt with and Image control ?
TIA,
#pragma
The following does not work.
PROCEDURE CopyControlToImage()
rectangle is structure
l is int
t is int
r is int
b is int
END
rect is rectangle
//hwnd is int = Handle(IMG_DROP)
hwndControl is int = Handle(CONTROL) // control handle can be button edit control etc.
hdcControl is system int = API( "user32","GetDC" , hwndControl)
// Get size
API("user32","GetWindowRect" , hwndControl , &rect)
HORZRES is int = rect.r - rect.l
VERTRES is int = rect.b - rect.t
IMG_DROP..Width=HORZRES
IMG_DROP..Height=VERTRES
dc is system int = dStartDrawing(IMG_DROP)
IF NOT API("gdi32","BitBlt" , dc , 0 , 0 , IMG_DROP..Width , IMG_DROP..Height , hdcControl , 0 , 0 , 0xCC00200) THEN
Error("BitBlt fails") // This does not happen.
END
//Cleanup
API("user32","ReleaseDC",hwndControl,hdcControl)
dEndDrawing()
Edited 2 time(s). Last edit at 10/10/2012 10:41PM by Pragma Tix.