Re: Drawing scaled lines
Re: Drawing scaled lines
- Subject: Re: Drawing scaled lines
- From: glenn andreas <email@hidden>
- Date: Fri, 7 Jan 2005 14:51:33 -0600
On Jan 7, 2005, at 2:42 PM, Andrew Zamler-Carhart wrote:
If you want to be precise about it, rather than having the user fetch a ruler, you could offer a popup menu and ask which display they have, and adjust your drawing accordingly. Resolutions and sizes are all available on www.apple.com, and you can use the following formula to get the dpi.
dpi = pixelsWide / (inches * cos(atan(pixelsHigh / pixelsWide)));
This is why NSSize uses doubles. ;-)
typedef struct _NSSize {
float width; /* should never be negative */
float height; /* should never be negative */
} NSSize;
NSTimeIntervals are doubles though...
Glenn Andreas email@hidden
<http://www.gandreas.com/> oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
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