public Bitmap GetScreenShot()
{
try
{
Screen.BitBlt(_hdcDest, 0, 0, CaptureWidth, CaptureWidth, _hdcSrc, _zones[0], _zones[1], 0x00CC0020);
return (Bitmap)_bitmap.Clone(); // Return a copy to avoid threading issues
}
catch (Exception ex)
{
Debug.WriteLine($"Capture Error: {ex.Message}");
return null;
}
}
public Bitmap GetScreenShot()
{
try
{
Screen.BitBlt(_hdcDest, 0, 0, CaptureWidth, CaptureWidth, _hdcSrc, _zones[0], _zones[1], 0x00CC0020);
return (Bitmap)_bitmap.Clone(); // Return a copy to avoid threading issues
}
catch (Exception ex)
{
Debug.WriteLine($"Capture Error: {ex.Message}");
return null;
}
}