None of those choices are any better than what he currently has. Windows has absolutely no idea how large your monitor is. The graphics driver just picks a size and uses it for everything (often 15" or 17").
···
On Fri, 1 Apr 2005 12:19:48 +0400, "Vladimir Ignatov" <100xcd@100xcd.com> wrote:
Chris, I notice you [in a FloatCanvas] use dc.GetPPI() for computations.
IMHO this is not quite right. This function returns "abstract" DPI that
appropriate, say, for writing it into image files. The "real" DPI can be
computed via GetSizeMM() or LogicalToDeviceXX functions (while in "physical"
modes such as wx.MM_TWIPS).
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Hello!
None of those choices are any better than what he currently has.
Windows has absolutely no idea how large your monitor is. The graphics
driver just picks a size and uses it for everything (often 15" or 17").
I believe driver can access "physical size" information either via
Plug'n'Play interface (then windows state "Monitor Type: Plug and Play
Monitor) or then one choose appropriate monitor driver for non-PNP monitors.
Of course it all depends on your goal. For my application I need the closest
possible match between "real size" and "displayed" size. I done several
tests and found that both methods (GetPPI and LogicalToDeviceXX) returns
different results. So I prefer the second method because it looks (for me)
more "correct". For example, on my home system (win2000) GetPPI() returns
always (96,96) regardless of the current display mode (from 800x600 to
1024x768) but LogicalToDevice() return different results accordingly.
Vladimir Ignatov
Tim Roberts wrote:
On Fri, 1 Apr 2005 12:19:48 +0400, "Vladimir Ignatov"
Chris, I notice you [in a FloatCanvas] use dc.GetPPI() for computations.
IMHO this is not quite right. This function returns "abstract" DPI that
appropriate, say, for writing it into image files. The "real" DPI can be
computed via GetSizeMM() or LogicalToDeviceXX functions (while in "physical"
modes such as wx.MM_TWIPS).
None of those choices are any better than what he currently has. Windows has absolutely no idea how large your monitor is. The graphics driver just picks a size and uses it for everything (often 15" or 17").
Right. I think it's a big mistake for systems to try to use ANY number for PPI, unless everything is scalable, which they are not, except maybe on modern OS-X apps. Even then, the user should be able to set what the system PPI is, rather than it being determined by monitor specs. After all, some folks run a lower resolution because they want everything to be bigger! I spend a lot of time having to make fonts larger on my system because it's trying to display a 10pt font at the "real" resolution. It may be accurate, but who can read a 10-pt font on a monitor? And what is the PPI of a projected image?
Anyway, ranting aside, The reason I use dc.GetPPI() is that I don't care what the PPI really is, I only care what the DC thinks it is. AFAICT, that's what is used to figure out how large to make a font, when it is specified in points. I really wish you didn't have to specify fonts in points, for the reason above, so what I use GetPPI() for in FloatCanvas is to re-scale font sizes so that users can specify font sizes in pixels, and they'll end up the same pixel size on all systems. This makes sense to me, as everything else is specified in pixels. (Line widths, etc) It seems to work.
-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
Chris.Barker@noaa.gov