Re: Drawing scaled lines
Re: Drawing scaled lines
- Subject: Re: Drawing scaled lines
- From: Robert Clair <email@hidden>
- Date: Fri, 7 Jan 2005 15:17:18 -0500
The default quartz coordinate system is PostScript points (1/72 of an
inch) and it
makes the assumption that displays are 72 dpi. Convenient, but not
reflective
of the real world. You have to scale the view bounds (see NSView
scaleUnitSquareToSize: or
NSView setBounds:) so that the ratio of the bounds width to the frame
width of the view
is (display dpi)/72.0.
Unfortunately there is no way to determine the display dpi
programatically, even in the case of
a laptop where the display is hardwired. There is some sample code
floating around that claims to
do it, but it uselessly returns 72 in all cases. You have to ask the
user to enter it (probably as a
preference).
A 15" TIBook is 101.4 dpi. (I have NO idea, it doesn't come out even in
metric either.)
Good luck,
Bob Clair
_______________________________________________
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