TPrintPreview and windows 8

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

TPrintPreview and windows 8

Postby PeterD » February 26th, 2013, 3:45 pm

Hi,

I've been using TPrintpreview for a while and it works perfect, thank you for the product!

I recently came across an issue when using TPrintPreview on a windows8 laptop. When the user has increased the font-size then TPrintPreview does not apply the Screen.PixelsPerInch corredctly.
On a win7 machine, the Screen.PixelsPerInch returns 120 when the font-size is increased to 125%. On windows8 it always returns 96, which makes TPrintPreview fail in showing the canvas correctly.

I found others reporting this issue about windows8 as well. On of the solutions I found was to read the registry HKEY_CURRENT_USER\CONTROL PANEL\Desktop\WindowMetrics which holds the correct value.

I ended up adjusting preview.pas so it reads the value from registry as well. When registry and Screen.PixelsPerInch are not the same, then I take the assumption the value from the registry is the correct one.

So far it seems to be working for me, so I thought to share this information.

Thanks for the great product again!

Peter
PeterD
Member
Member
 
Posts: 1
Joined: February 26th, 2013, 3:33 pm

Re: TPrintPreview and windows 8

Postby Kambiz » February 26th, 2013, 5:55 pm

You're very welcome!

Thanks for sharing this information.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: TPrintPreview and windows 8

Postby jcmartini » January 6th, 2015, 11:26 am

Hello Peter, Kambiz,

I am using TPrintPreview for years with C++Builder and it works fine now with XE7 under W7. Thanks a lot for your valuable work Kambiz.

I am now facing with the same problem, I believe, (without font scaling) in using my application on a laptop running W8.1: TPrintPreview do not fill the paper's with and length. I am not very used with Delphi and I am interested to apply the modification you did (reading to the the registry HKEY_CURRENT_USER\CONTROL PANEL\Desktop\WindowMetrics). I get the same result with the demo programs. So, could you give us the update you wrote to preview.pas ?

Thanks in advance.

Jean-Claude
jcmartini
Member
Member
 
Posts: 3
Joined: September 24th, 2012, 8:57 am

Re: TPrintPreview and windows 8

Postby jcmartini » January 12th, 2015, 9:39 am

Hello,
I am surprise that nobody has the same problem. I join a screen capture for showing my problem. Maybe I didn't found it in the forum (?).
Regards.
Jean-Claude
Attachments
PrintPreview_W8.1.gif
PrintPreview_W8.1.gif (19.29 KiB) Viewed 3112 times
jcmartini
Member
Member
 
Posts: 3
Joined: September 24th, 2012, 8:57 am

Re: TPrintPreview and windows 8

Postby jcmartini » March 23rd, 2015, 9:36 am

My problem was finally solved by including a manifest file in the demo (application->options).
See: http://stackoverflow.com/questions/2685 ... upport-per

Regards
Jean-Claude
jcmartini
Member
Member
 
Posts: 3
Joined: September 24th, 2012, 8:57 am


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron