• 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 1 pixel wide lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: drawing 1 pixel wide lines


  • Subject: Re: drawing 1 pixel wide lines
  • From: Nathan Day <email@hidden>
  • Date: Thu, 8 Aug 2002 11:03:29 +0930

add 0.5 to the x component of p1 and p2, the coordinate system uses floats so whole number values represent the border between two pixels, you want to draw in the middle of a pixel so it +0.5.

On Thursday, August 8, 2002, at 04:43 AM, Albert Russel wrote:

How do you draw 1 pixel wide completely black vertical lines?

[NSBezierPath setLineWidth: 0.0];
[NSBezierPath setDefaultFlatness: 1.0];
[NSBezierPath setLineCapStyle: NSButtLineCapStyle];
[[NSColor blackColor] set];
[NSBezierPath strokeLineFromPoint: p1 toPoint: p2];

The above gives vertical lines that are more than 1 pixel wide, I believe to
see 2, and the lines are a little transparent. I select the color black but
the lines are gray. When I draw 2 lines at the same position it gets black.


Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
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: 
 >drawing 1 pixel wide lines (From: "Albert Russel" <email@hidden>)

  • Prev by Date: Re: Cocoa development using Java - Suggested references
  • Next by Date: (no subject)
  • Previous by thread: Re: drawing 1 pixel wide lines
  • Next by thread: X Word demo broken
  • Index(es):
    • Date
    • Thread