thornsoft
11-May-2005, 03:00 PM
The screenshot is always of the primary monitor, which may or may not be relevant to the error. I recommend using the screen of the active form in the application, or else make a screenshot of the whole desktop.
snips of code to help:
GetCursorPos ( P ); // Where am I?
M := Screen.MonitorFromPoint ( P, mdNearest ).MonitorNum;
// Here I am! Monitors[M]
BitBlt ( fBMP.Canvas.handle, 0, 0, Screen.Monitors [ M ].Width, Screen.Monitors [ M ].Height,
ScreenDC, Screen.Monitors [ M ].Left, Screen.Monitors [ M ].Top, srcCopy );
There's a "capturewholedesktop" approach:
fBitmap.Width := Screen.DesktopRect.Right - Screen.DesktopRect.Left;
fBitmap.Height := Screen.DesktopRect.Bottom - Screen.DesktopRect.Top;
BitBlt ( fBitmap.Canvas.Handle, 0, 0, fBitmap.Width, fBitmap.Height, ScreenDC, 0, 0, SRCCOPY );
snips of code to help:
GetCursorPos ( P ); // Where am I?
M := Screen.MonitorFromPoint ( P, mdNearest ).MonitorNum;
// Here I am! Monitors[M]
BitBlt ( fBMP.Canvas.handle, 0, 0, Screen.Monitors [ M ].Width, Screen.Monitors [ M ].Height,
ScreenDC, Screen.Monitors [ M ].Left, Screen.Monitors [ M ].Top, srcCopy );
There's a "capturewholedesktop" approach:
fBitmap.Width := Screen.DesktopRect.Right - Screen.DesktopRect.Left;
fBitmap.Height := Screen.DesktopRect.Bottom - Screen.DesktopRect.Top;
BitBlt ( fBitmap.Canvas.Handle, 0, 0, fBitmap.Width, fBitmap.Height, ScreenDC, 0, 0, SRCCOPY );