• 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: Pixel Drawing Program 2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pixel Drawing Program 2


  • Subject: Re: Pixel Drawing Program 2
  • From: Shawn Erickson <email@hidden>
  • Date: Sat, 15 Feb 2003 09:38:44 -0800

On Friday, February 14, 2003, at 07:16 PM, Sebastian Gomez Papiol wrote:

Wow, it's true! Where you find this information? very thanks... this is OK for simple lines, but drawing curves or ovals of 1 pixel seems more difficult. Perhaps I can change the (0,0) origin to (0.5, 0.5) origin with some method or perform some trick?

Quartz 2D closely follows PDF and postscript drawing environments, I think I picked up on the fact that pixel are centered by reading comments on this list a year or two back. Anyway...

Drawing curved paths or any path not aligned (and centered) with x or y axis will result in the true mathematical path falling between pixels and hence an attempt must be made to approximate the path. If anti-aliasing is turned on then the path will be approximated by partly "turning" on pixels to various degrees based on how close they are to the mathematical path. If anti-aliasing is turned off then pixels near the mathematical line will be fully turned on and you will get a more gagged line.

This is the reality when rendering paths on a fixed pixel system (screen, printer, etc.).

Basically saying the the path is 1 point wide does not mean one pixel wide on screen but 1 point wide in the paths mathematical form. Don't forget the same path you draw to the screen a 72 DPI can be drawn at, for example, 300 DPI just by switching graphics contexts. In the 300 DPI case the line is still 1 point wide in mathematical form but many pixels wide when rendered because more pixels are available at the higher resolution in the same coordinate grid.

-Shawn
_______________________________________________
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: 
 >Pixel Drawing Program 2 (From: Sebastian Gomez Papiol <email@hidden>)

  • Prev by Date: Re: Get path to user preference folder, updated
  • Next by Date: Re: Get path to user preference folder, updated
  • Previous by thread: Pixel Drawing Program 2
  • Next by thread: embedding libraries
  • Index(es):
    • Date
    • Thread