Board index » cppbuilder » how to get pixels per inch property of monitors

how to get pixels per inch property of monitors


2003-09-13 11:13:37 PM
cppbuilder59
Hi,
I need to know how many Pixels is in 1 inch of monitor (vertical and
horizontal)
Screen->PixelsPerInch doesn't change when I'm changing resolution.
How can I get this numbers??
 
 

Re:how to get pixels per inch property of monitors

well that's normal..
i do think the PixelsPerInch originally based it self from printers.
in any case there is no sure way to determine that via a monitor.
you would have to ask the user to measure their screen and put in
numbers.
Sobciu wrote:
Quote
Hi,

I need to know how many Pixels is in 1 inch of monitor (vertical and
horizontal)
Screen->PixelsPerInch doesn't change when I'm changing resolution.
How can I get this numbers??
 

Re:how to get pixels per inch property of monitors

On Sat, 13 Sep 2003 17:13:37 +0200, "Sobciu" < XXXX@XXXXX.COM >wrote:
Quote
Hi,

I need to know how many Pixels is in 1 inch of monitor (vertical and
horizontal)
Screen->PixelsPerInch doesn't change when I'm changing resolution.
How can I get this numbers??

Windows doesn't provide this information for monitors. PixelsPerInch
is based on the information that Windows does provide which is
basically a fixed number (it can be adjusted by choosing "large
fonts", "small fonts", or custom scaling in the Display control
panel). On many systems it will be 96 for small fonts and 120 for
large fonts.
If you really want to know what an inch is you need to have some sort
of facility for the user to calibrate your program, probably using the
Windows provided value as a starting point. Many programs don't
bother with this and just use the number that Windows provides.
Chris Hill
XXXX@XXXXX.COM
 

{smallsort}

Re:how to get pixels per inch property of monitors

"Sobciu" < XXXX@XXXXX.COM >wrote:
Quote
I need to know how many Pixels is in 1 inch of monitor
(vertical and horizontal) [...]
Look at the win32 API GetDeviceCaps
~ JD
 

Re:how to get pixels per inch property of monitors

"Sobciu" < XXXX@XXXXX.COM >wrote in message
Quote
I need to know how many Pixels is in 1 inch of monitor
(vertical and horizontal)
Look at the Win32 API function GetDeviceCaps() with the LOGPIXELSX and
LOGPIXELSY flags. Use GetDC(0) to get the HDC for the screen.
Quote
Screen->PixelsPerInch doesn't change when I'm
changing resolution.
The PixelsPerInch property is only intialized once at program startup. The
VCL does not update itself during very many system changes at all, if any.
Gambit
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03