TPrintPreview on high DPI with external monitor

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

TPrintPreview on high DPI with external monitor

Postby wordweb » February 21st, 2016, 11:57 pm

TPrintPreview is generally great and really useful.

But I now have an odd problem with scaling. I have a high-res laptop (240 dpi), and an external standard res (120dpi) monitor. My app is DPI aware (but not per-monitor aware). When I do print preview with the program running only on the external monitor (so the program thinks it is 240 dpi, but actually Windows is scaling down), I only see half of the page rendered:

problem.png
problem.png (41.07 KiB) Viewed 2730 times


I can fudge it to come out right by multiplying FDeviceExt by 2 in UpdateExtends, but that's clearly not the right thing to do in general.

There are no other problems with my app, so not sure where the inconsistency is creeping in. Screen.PixelsPerInch and the GetDeviceCaps calls are all returning consistent values (240DPI). It looks perfect running on the laptop screen.

Any ideas/fixes?

Thanks for a useful component.
wordweb
Member
Member
 
Posts: 1
Joined: February 21st, 2016, 11:23 pm

Re: TPrintPreview on high DPI with external monitor

Postby sh17 » March 16th, 2016, 1:48 pm

I'm working in this issue.
sh17
Active Member
Active Member
 
Posts: 8
Joined: September 3rd, 2013, 11:38 am

Re: TPrintPreview on high DPI with external monitor

Postby am3 » April 27th, 2016, 2:01 pm

Hello,
And many thanks for this component.
I'm not sure that my problem is linked to the high dpi monitor, but I have a similar problem of proportion when I update windows zoom from 100% to 150 % on Windows 7 (windows 10 often set this zoom to 200% for big screens).
The problem is that I draw a rectangle using the PageBounds property (TRect values).
If the windows zoom is set to 200%, the rectangle will be drawn at the quarter top left of the page.
Regards.
Nicolas

Edit : maybe the problem is linked to screen.pixelperinch (96) not updated depending on the zoom on Windows 7 ?
am3
Member
Member
 
Posts: 1
Joined: April 27th, 2016, 1:53 pm

Re: TPrintPreview on high DPI with external monitor

Postby VPC16 » August 30th, 2016, 2:38 pm

Has to do with WIndows' Virtualization of the screen on Windows. I am looking at getting the native resolution of the screen and changing the unit to allow for higher resolution when the Visualized preview page displays. All other forms work well with Virtualization so this is the only form for me with an issue. Many folks are reporting this problem with new W10 and the new lower cost high res screens.

Any suggestions on doing this would be great. Great component, thanks for working on it!
VPC16
Active Member
Active Member
 
Posts: 15
Joined: August 30th, 2016, 2:26 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 46 guests

cron