Re: How do you draw a single pixel line?
Re: How do you draw a single pixel line?
- Subject: Re: How do you draw a single pixel line?
- From: Dietmar Planitzer <email@hidden>
- Date: Thu, 15 Aug 2002 23:59:33 +0200
>
From: Paul Fox <email@hidden>
>
>
Are you guessing at the answer or do you know this works for sure?
>
>
I tried 0.25, 0.20, 0.0 and same results each time.
Okay, just dug out my good old test app again:
There are more or less two possible ways to get thin diagonal lines with
Quartz:
1) With anti-aliasing turned on, set the line width to 0.8 or 0.75. Setting
the line width to a greater value will result in thick lines. Setting it to
a smaller value will result in a barely visible line. The latter happens
because the area covered by the line becomes smaller and smaller compared to
the area of a single pixel, thus the pixels along the line are assigned a
small coverage value which translates into a small alpha value.
2) With anti-aliasing turned off, set the line width to 0.1 or even 0.01.
You may also try to play around with the context's stroke adjust value:
void CGContextSetStrokeAdjust(CGContextRef ctx, int zeroOrOne)
If this doesn't help, then I think nothing will...
BTW: Quartz doesn't support zero-width lines like (D)PS. So, setting the
line width to 0.0 in the anti-aliased case results in an invisible line and
in the aliased case in a 1 pixel width line.
Regards,
Dietmar Planitzer
_______________________________________________
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.