• 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: What units are in effect when drawing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What units are in effect when drawing?


  • Subject: Re: What units are in effect when drawing?
  • From: publiclook <email@hidden>
  • Date: Sat, 5 Apr 2003 18:27:39 -0500

The whole point of basing the coordinate system on a "real" unit like points, inches, millimeters, or miles is that it is device independent. Any drawing based on pixels will be wrong an any device that uses different sized pixels. Using (Postscript) points as units is a large part of what makes Display Postscript (I mean Display PFD) (I mean Quartz 2D) device independent. It works equally well on low resolution monitors and on 1200 dpi laser printers and on 2000 dpi film.

The fact that Apple chooses to pretend that pixels on your display are 1 point square whether they really are or not is a convenience and an optimization. In the future, Apple might provide a way to tell Quartz what you think the real resolution (size of a pixel) on you display is. Then Quartz can draw a 72 point wide line so that it is an inch wide as measured with a ruler pressed against your display. In the mean time, a 72 point wide line will continue to be an inch wide on the 1200 dpi printer because a point is a point is a point as long as the true resolution of a device is known.


On Saturday, April 5, 2003, at 02:58 PM, Chris Hanson wrote:

At 7:05 PM +0300 4/5/03, Janek Priimann wrote:
> What are the default units when drawing in a custom view? Picas?
Points? mm?

The default units are points.
But because all the macintosh computers use 72dpi resolution
and 1 inch equals to 72 points then 1 point = 1 pixel.

However, you shouldn't necessarily assume this.

IBM has been shipping a 24-inch 200dpi LCD display for a year now, and ViewSonic is OEMing it. I suspect its price will come down to the level of the original Cinema Display soon. Other vendors are also increasing display density rapidly.

I have no idea what Apple's future plans are for CoreGraphics (and couldn't say if I did know), but I suspect at some point in the next few years we'll see true resolution independence in the display architecture. I'd rather my code Just Work when that comes about.

Also, you can't assume one point is equal to one pixel when your view is printing. After all, on a 1200dpi printer, a one by one point dot is 16.7 by 16.7 "pixels"...

-- Chris

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: What units are in effect when drawing? (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: What units are in effect when drawing?
  • Next by Date: Re: Showing NSView's contextual menu on mouse down
  • Previous by thread: Re: What units are in effect when drawing?
  • Next by thread: Re: What units are in effect when drawing?
  • Index(es):
    • Date
    • Thread