Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing Thin Lines in Core Graphics



You are probably running into a difference in the way CG colors pixels.

If the line you are drawing is on an integer coordinate (5.0, for example)
then the line falls between two pixels and therefore CG colors the pixels on
either side at 50%. The end result is that you get a 2 pixel wide 50% line.

That's probably simplifying a bit but the CG guys can correct me.

You can bump your line coordinates over by 0.5 to draw down the middle of
the pixels. Another possibility is to just adjust the CTM with a
translation and keep the same line coordinates.

Dave


On 2/28/02 9:34 AM, "Nick Nallick" <email@hidden> wrote:

>> Just a guess...but....
>>
>> Turn of antialiasing
>>
>> Mark
>>
>> on 2/28/02 12:01 PM, Nick Nallick at email@hidden wrote:
>>
>>> I'm trying to draw horizontal and/or vertical lines that are a single pixel
>>> wide into a Core Graphics context on the screen. I'm creating a path
>>> containing a line and stroking it. Unfortunately I don't seem to be able to
>>> draw a line any thinner than two pixels wide. If I specify a smaller stroke
>>> width the color of the line become lighter but it's still two pixels wide.
>>>
>>> How do I get lines that are one pixel wide in CG?
>>>
>>> Thanks,
>>> Nick Nallick
>
> I tried turning off antialiasing and InterpolationQuality (whatever that is)
> but it didn't make any difference.
>
> Nick
> _______________________________________________
> carbon-development mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/carbon-development
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Drawing Thin Lines in Core Graphics (From: Nick Nallick <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.