Re: Drawing scaled lines
Re: Drawing scaled lines
- Subject: Re: Drawing scaled lines
- From: John Stiles <email@hidden>
- Date: Fri, 7 Jan 2005 11:52:48 -0800
There is no way to figure out the actual physical size of a monitor
programatically. And every monitor is going to be a little bit
different.
Apple's current flat-panel lineup is all *about* 100dpi, but each model
is slightly off. I don't remember the exact numbers.
Third-party monitors—particularly CRTs—will vary wildly and of course
it will also depend on resolution chosen by the end user.
I would let the user configure this. Render a line on the screen, ask
them to measure it and tell you how long it is, and then you can work
backwards to figure out the exact DPI of the screen. I'd default to 100
until otherwise configured, so you'll be "pretty close" on an Apple
flat-panel right out of the box.
On Jan 7, 2005, at 11:41 AM, Mark Dawson wrote:
I want to draw line figures (lines, rects, etc) that are correctly
scaled (i.e., 1" on screen is 1' in real life). I haven't quite
figured out the question to ask to find the correct documentation…
I've found that NSSize is the basic size, which contains floats. From
what I can tell, they are in "point" units. Do I just use the 72.0
points/inch constant, or is there a system call that I should use?
Give than NSize uses floats, what does it mean to have 1.01
points--i.e., do fractional points show up?
Thanks,
mark
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden