Closed billybednar closed 1 year ago
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 config.ini
.
Try this build. Is the problem still exists?
Same issue with me
@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: AutoScreenshot_v1.11-2-g6edfe70_Windows_portable.zip
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.
Unfortunately I couldn't figure out exactly what the pattern is.
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:
[07:57:40.303] Region: l=-1680,t=-1080,r=1920,b=1080
and
[10:07:43.278] Region: l=-1920,t=0,r=3840,b=1200
I can make a separate bug with more details if you want.
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 TBGRABitmap.LoadFromDevice
bug from external package. I don't observe this problem in Linux. In Windows BitBlt
function may be used directly. I used this solution:
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.
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