I've found that DCS have a GetPPI() method, whioch is very hand when
trying to deal with sizing text etc. However, there is no SetPPI()
method for the screen DCS (PaintDC, ClientDC, etc). The problem, is that
the system apparently doesn't report the correct number. FRankly, PPI
just doesn't make that much sense for computer screens anyway...would
you want to have 5 ppi when you hook your machine up to a projector?
The reason this is an issue is that fonts are defined in terms of
Points, rather than pixels, and then scaled according to what wxWindows
thinks the PPI of the screen is. This is annoying enough as is, but is a
particular problem because my linex and Windows systems report different
numbers, even though they are running on the same machine, with the same
resolution. Frankly, this is probably mostly X-windows' fault, but I'm
not sure It wouldn't be a problem anyway.
When I draw something on a DC, I want to know what it's going to look
like. Everything else I draw is defined in terms of pixels, but text
size is in points, so I don't know what I'm going to get without calling
GetPPI(), and then doing the math. What I'd much rather do is be able to
call DC.SetPPI( (72,72) ), and be done with it. Is there any way to do
something like this?
Note: Being able to define fonts in terms of pixel size would help
too....
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I've found that DCS have a GetPPI() method, whioch is very hand when
trying to deal with sizing text etc. However, there is no SetPPI()
method for the screen DCS (PaintDC, ClientDC, etc). The problem, is that
the system apparently doesn't report the correct number. FRankly, PPI
just doesn't make that much sense for computer screens anyway...would
you want to have 5 ppi when you hook your machine up to a projector?
It doesn't use the physical inches, but "logical inches" of the display, so it is normalized somewhat for differences in physical display size. Anyway, the value is determined by calling a platform API (GetDeviceCaps on Windows) and I don't think that applications are allowed to change things like that.
The reason this is an issue is that fonts are defined in terms of
Points, rather than pixels, and then scaled according to what wxWindows
thinks the PPI of the screen is. This is annoying enough as is, but is a
particular problem because my linex and Windows systems report different
numbers, even though they are running on the same machine, with the same
resolution. Frankly, this is probably mostly X-windows' fault, but I'm
not sure It wouldn't be a problem anyway.
IIRC, X will either just use a value of 100 ppi, or if possible will use the physical size of the display to calculate the true ppi.
When I draw something on a DC, I want to know what it's going to look
like. Everything else I draw is defined in terms of pixels, but text
size is in points, so I don't know what I'm going to get without calling
GetPPI(), and then doing the math. What I'd much rather do is be able to
call DC.SetPPI( (72,72) ), and be done with it. Is there any way to do
something like this?
Not that I know of.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!