• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drawing scaled lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Drawing scaled lines (From: Mark Dawson <email@hidden>)
 >Re: Drawing scaled lines (From: John Stiles <email@hidden>)
 >Re: Drawing scaled lines (From: Andrew Zamler-Carhart <email@hidden>)

  • Prev by Date: Re: image drawing glitch
  • Next by Date: Re: How can I right-justify items in an NSPopUpButton?
  • Previous by thread: Re: Drawing scaled lines
  • Next by thread: Re: Drawing scaled lines
  • Index(es):
    • Date
    • Thread