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: Paul Fox <email@hidden>
- Date: Sun, 6 Oct 2002 08:56:36 +0100
>
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.
Afraid not - at least not in 10.1. I tried that. It stops the line
being smudged but is at least two pixels wide. I tried using
the +0.5 trick to the co-ords and similar results.
If you have code that does it, then I would be happy to learn the
error of my ways, but certainly antialiasing isnt it.
I havent tried image interpolation - could possibly be that, and I will
give it a try.
thanx
>
@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.