Re: drawing a very long line on the screen and how much of the lifting I have to do

"'Chris Barker' via wxPython-users" <[email protected]> Sat, 3 Jul 2021 09:38:33 -0700
Newsgroups gmane.comp.python.wxpython
Message-ID <CALGmxEKOOqc_MZ_D+_Srd1uZ1Z-ncBnNanxDirowMC_K=ASo8A@mail.gmail.com>
On Fri, May 28, 2021 at 2:45 PM Tim Roberts <[email protected]> wrote:

> > I ended up going with around 12.5 pixels to the half CM.
>
> As long as you're just using it for relative placement, that's perfectly
> OK.  But if you're doing something where real-world measurements matter,
> it's not that easy.  12.5 pixels per 0.5cm comes out to 64 pixels per
> inch.  Most Windows displays run 96 ppi, many run 120, but these days
> the variation is quite large.
>

The whole pixels-per-inch (or any unit of length) is a nightmare. It always
was, but when folks almost exclusively used physical monitors with similar
specs, it wasn't too bad. Then there were projectors -- what the heck is
the PPI of a projection on a screen?

Then very high resolution monitors (and laptop screens) came out -- se
Apple's "retina" display: 326PPI. This caused real confusion because you
might have a real problem because a lot of apps used pixels as raw
coordinates (for icons and the like) and a, eg 32x32 pixel icon is
absolutely tiny. So theyhave a kind o hybrid "virtual PPI" mess.

Anyway, as much as possible, stay the heck away fro pixels and PPI.

This was actually one of the drivers behind why I originally wrote
wx.lib.floatcanvas : I really wanted to keep the concept of pixels away
from my code as much as possible.

I do recommend for any kind of graphics (drawing lines, etc), that you use
a coordinate system that is NOT pixels, (or in, or cm) -- and do the final
translation to pixels at the last moment possible.

floatcanvas may be a good choice, or maybe not, depending on your use case.

-CHB






>
> It's quite possible your app doesn't care -- most don't  -- but it's
> something to tuck away for later.
>
> --
> Tim Roberts, [email protected]
> Providenza & Boekelheide, Inc.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wxpython-users/613563f7-bf82-23df-31b6-16582a0d5ec9%40probo.com
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CALGmxEKOOqc_MZ_D%2B_Srd1uZ1Z-ncBnNanxDirowMC_K%3DASo8A%40mail.gmail.com.