Re: How to draw a 1-pixel non Antialiased line
Re: How to draw a 1-pixel non Antialiased line
- Subject: Re: How to draw a 1-pixel non Antialiased line
- From: Vince DeMarco <email@hidden>
- Date: Sat, 5 Oct 2002 18:30:30 -0700
On Saturday, October 5, 2002, at 04:00 PM, Paul Fox wrote:
Update on this long standing issue -- how to draw a 1-pixel wide
diagonal line.
The Answer is simply to use the QuickDraw routines. I have tried
everything possible within Cocoa/NSBezierPath to no avail. I can
draw 1 pixel wide lines using the tricks suggested by various people
on this list if the line is horizontal or vertical, but none of them
work for diagonals.
Just turn off Antialiasing.
@interface NSGraphicsContext(NSGraphicsContext_RenderingOptions)
- (void)setShouldAntialias:(BOOL)antialias;
- (BOOL)shouldAntialias;
- (void)setImageInterpolation:(NSImageInterpolation)interpolation;
- (NSImageInterpolation)imageInterpolation;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2
- (void)setPatternPhase:(NSPoint)phase;
- (NSPoint)patternPhase;
#endif
But using QuickDraw (NSQuickDrawView), I can do it.
I raise the issue in case anyone wants to add to this - as I would
prefer a native-Cocoa solution, but in this instance, I had to do
something about it - they just looked so awful being double width.
thanks all
_______________________________________________
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.