• 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
How to draw a single pixel line?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to draw a single pixel line?


  • Subject: How to draw a single pixel line?
  • From: Stefan Leuker <email@hidden>
  • Date: Sun, 10 Mar 2002 10:48:49 +0100

Hello all,

thanks to the power of Quartz, it seems to be difficult to draw a single pixel horizontal line.

Here's what I tried:
Using NSBezierPath, the line is either anti-aliased (and the color is blurred), or when turning anti-aliasing off, it is two pixels high.
Using CoreGraphics directly has the same effect.
I also tried setting the line width to something between 0 and 1, but it makes no visible difference. 0 results in the line not being drawn at all.

A current workaround is to use the NSFrameRect() call and draw a one pixel high box, which indeed gives me a fine single pixel line without anti-aliasing, but this call is limited to solid lines. So I cannot use line patterns. This might be required in the future.

Am I missing something obvious here?

Thanks for your help,
Stefan
_______________________________________________
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.

  • Follow-Ups:
    • Re: How to draw a single pixel line?
      • From: Ben Hines <email@hidden>
  • Prev by Date: Re: Text URL in Dialog?
  • Next by Date: Re: Aaron Hillegass Book
  • Previous by thread: Re: Screen Savers and OpenGL
  • Next by thread: Re: How to draw a single pixel line?
  • Index(es):
    • Date
    • Thread