by Jared >> Wed, 17 Aug 2005 11:20:49 GMT
Hi all. I tried converting some VB code, that captures the screen , into JADE but so far no luck. Its very basic. I have 4 external functions:
jBitBlt(hDCDest : Integer;
xDest : Integer;
yDest : Integer;
nWidth : Integer;
nHeight : Integer;
hDCSrc : Integer;
xSrc : Integer;
ySrc : Integer;
dwRop : Integer) : Boolean is BitBlt in gdi32;
jGetDesktopWindow() : Integer is GetDesktopWindow in user32;
jGetWindowDC(hWnd : Integer) : Integer is GetWindowDC in user32;
jReleaseDC(hWnd : Integer; hdc : Integer) : Integer is ReleaseDC in user32;
and the method is running off a button:
getScreenPlease_click(btn: Button input) updating;
constants
SRCCOPY : Integer = 13369376;
vars
hWndDesk : Integer;
hDCDesk : Integer;
leftDesk : Integer;
topDesk : Integer;
widthDesk : Integer;
heightDesk : Integer;
result : Boolean;
begin
leftDesk := 0;
topDesk := 0;
widthDesk := 1024;
heightDesk := 768;
hWndDesk := call jGetDesktopWindow();
hDCDesk := call jGetWindowDC(hWndDesk);
result := call jBitBlt(picture1.hwnd, 0, 0, widthDesk, heightDesk, hDCDesk, leftDesk, topDesk, SRCCOPY);
call jReleaseDC(hWndDesk, hDCDesk);
write "result: " & result.String;
end;
Does anyone see where I am going wrong? It keeps returning false and not copying the image into picture1.
Any help would be much appreciated.
Jared.