ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 CaptureFromScreen not work corretly with 150% resolution on windows 11

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Morgan Posted - Aug 28 2023 : 08:10:55
Hi,

I use this function :
ImageScreen->IO->CaptureFromScreen(iecsSpecifiedMonitor , -1, 0);


and
ImageScreen->IO->SaveToFile("...path...\\ImageEn_CaptureFromScreen_iecsSpecifiedMonitor.jpg");
to save result;

The result is :



with the resolution 150% :




But the expected result is :




What needs to be done to solve the problem?
Without changing the screen resolution, of course.

Best regards,
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 29 2023 : 19:21:05

Hi

The problem is that we're not doing any special calculations, we're just using Screen.Monitor values. You have disabled an option that is recommended for modern applications (in newer Delphi it should be "Per Monitor v2"), so to support it, we would need to determine that High DPI is turned off and then add the high DPI code ourselves (not just in this method, but in the many other methods of ImageEn that assume high DPI support is enabled). In effect, we'd be making ImageEn High DPI aware even though your manifest specifies that it should not be.

You would be better to enable high DPI and correct any old components that do not support it.

If you really only want this one feature to be DPI aware, then copy the TImageEnIO.CaptureFromScreen() method to a local unit and add some scaling code (e.g. xx := xx * Monitor PixelsPerInch / 96).

Nigel
Xequte Software
www.imageen.com
Morgan Posted - Aug 29 2023 : 03:52:24
Hi,

I've found the C++ Builder configuration that's causing problems:




We can't activate this parameter because other old components we use don't work properly with this option.

Can you see if a fix is possible when this option is disabled?
xequte Posted - Aug 29 2023 : 03:11:16
Hi

I'm afraid I don't have that version installed to test. I can confirm that it works fine in Delphi 5, 2007 and 11, so I think there might be something else going on.

You might want to walk through the code to see where it was failing, or use a different method of screen capture.

Nigel
Xequte Software
www.imageen.com
Morgan Posted - Aug 29 2023 : 01:55:44
Hi,

I use C++ Builder 10 Seattle.
xequte Posted - Aug 28 2023 : 17:08:43
Hi

I cannot reproduce that in v12.5.0. The full window is captured for all scaled screens with iecsSpecifiedMonitor on my test Windows 11 system. However I cannot see any changes to the code since 10.0.1 that should have affected that.

What version of C++Builder are you using?



Nigel
Xequte Software
www.imageen.com
Morgan Posted - Aug 28 2023 : 08:19:52
I use ImageEn 10.0.1.
Has this problem been corrected since this version?
If so, which version?