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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 CaptureFromScreen not work corretly with 150% resolution on windows 11
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Morgan

France
7 Posts

Posted - Aug 28 2023 :  08:10:55  Show Profile  Reply
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,

Morgan

France
7 Posts

Posted - Aug 28 2023 :  08:19:52  Show Profile  Reply
I use ImageEn 10.0.1.
Has this problem been corrected since this version?
If so, which version?
Go to Top of Page

xequte

38611 Posts

Posted - Aug 28 2023 :  17:08:43  Show Profile  Reply
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
Go to Top of Page

Morgan

France
7 Posts

Posted - Aug 29 2023 :  01:55:44  Show Profile  Reply
Hi,

I use C++ Builder 10 Seattle.
Go to Top of Page

xequte

38611 Posts

Posted - Aug 29 2023 :  03:11:16  Show Profile  Reply
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
Go to Top of Page

Morgan

France
7 Posts

Posted - Aug 29 2023 :  03:52:24  Show Profile  Reply
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?
Go to Top of Page

xequte

38611 Posts

Posted - Aug 29 2023 :  19:21:05  Show Profile  Reply

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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: