-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screenshots fail with "Cannot get raw image from device" #35
Comments
Same issue with me on 1.11 portable version, running Windows 11 22H2. It also worked fine before on 1.10.4 and 1.10.3 portable versions I even tried deleting my config and using default settings, still the same issue. |
@billybednar How many displays do you have/capture from? And which resolution? |
Show your Try this build. Is the problem still exists? |
@jessedufrene Could you also attach your log? |
log.txt - i manually triggered screenshots twice. i hit ok the first time, and abort the second time. i've got 3 displays, a total of 5760x1200 just tried the 1.11-3 build and it looks like it works fine |
3 displays arranged with an offset. It fails when capturing from all monitors or either of the secondary monitors, but not the primary (the one in blue). It also occurs with the default generated config.ini. The new build fixes it. |
Thanks for important information. Just another check: Is the bug occurs in this build or not? |
The bug is back in that build. I tried rearranging the monitors many different ways and the positions definitely have an impact on it. Unfortunately I couldn't figure out exactly what the pattern is. While testing these, I noticed that you get an access violation when opening a portable copy if there is already an instance running out of a different location. It only happens the first time when there is no config.ini. If you try again, it will exit cleanly instead of crashing. I can make a separate bug with more details if you want. |
I found it. The error occurs if you have any display above or to the left of the primary one. Like in this example: In this case top-left coordinate of all visible area will be negative and this cause fails after some modifications in v1.11. For comparision in this case capturing works fine: |
In logs you send me there is negative coordinates:
and
|
Yes, please make separate issue report for another problem. |
Looks like the Windows implementation of RawImage_FromDevice takes a screenshot of the entire desktop with the incorrect assumption that the upper-left corner is (0, 0) and then tries to extract the desired region from the bitmap. |
@billybednar I thought this is var
Bitmap: TBGRABitmap;
......
{$IfDef Windows}
BitBlt(Bitmap.Canvas.Handle, 0, 0, ARect.Width, ARect.Height,
ScreenDC, ARect.Left, ARect.Top, SRCCOPY);
{$EndIf}
{$IfDef Linux}
Bitmap.LoadFromDevice(ScreenDC, ARect);
{$EndIf} |
I think you should create issue report in Lazarus repository. |
Fixed in v1.12. Please check. |
Hello. I'm popping by to notify that I've created the bug report 40857 for Lazarus. I suggest you have a look. Regards |
Describe the bug
After upgrading to v1.11, taking a screenshot fails 100% of the time with the error "Cannot get raw image from device." This occurs for both manual and automatic captures. If OK is clicked, the program continues but no screenshot is saved. If abort is clicked, the program exits. If nothing is clicked and automatic screenshot are on, the program exits when the next attempt fails occurs.
To Reproduce
Screenshots
Version
v1.11
OS
Windows 10 Pro 22H2 (build 19045.2965), 64 bit
Additional context
Works again after reverting to 1.10.4, although in the past I've occasionally had corrupt screenshots like the one in #32.
Log file
log.txt - doesn't look like anything useful
The text was updated successfully, but these errors were encountered: