Page 1 of 1

TPrintPreview on high DPI with external monitor

PostPosted: February 21st, 2016, 11:57 pm
by wordweb
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 1712 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.

Re: TPrintPreview on high DPI with external monitor

PostPosted: March 16th, 2016, 1:48 pm
by sh17
I'm working in this issue.

Re: TPrintPreview on high DPI with external monitor

PostPosted: April 27th, 2016, 2:01 pm
by am3
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 ?

Re: TPrintPreview on high DPI with external monitor

PostPosted: August 30th, 2016, 2:38 pm
by VPC16
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!