Re: lockFocus clearing current color
Re: lockFocus clearing current color
- Subject: Re: lockFocus clearing current color
- From: Ian was here <email@hidden>
- Date: Sat, 16 Apr 2005 09:57:11 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
After locking focus onto another view/image, you may
need to set the color again, otherwise it will default
to black.
--- Jonathon Mah <email@hidden> wrote:
> Hi,
>
> This feels like it should have a simple answer, but
> I've searched and
> can't find anything. I'm trying to draw an
> NSBezierPath into an NSImage
> with the current color. I can break it down to this
> case:
>
> NSImage *myImage = [[NSImage alloc]
> initWithSize:[path bounds].size];
> [myImage lockFocus];
> [path fill];
> [myImage unlockFocus];
>
> The problem is that the path is filled with black
> instead of the
> current drawing color (which was set just above).
> How can I maintain
> that color when drawing into my image?
>
> (I can't put [someColor set] immediately above [path
> fill], as the
> color will be set somewhere, then this method will
> be called.)
>
> Thanks,
>
>
> Jonathon Mah
> email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be
> ignored.
> Cocoa-dev mailing list
> (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
>
> This email sent to email@hidden
>
__________________________________
Do you Yahoo!?
Plan great trips with Yahoo! Travel: Now over 17,000 guides!
http://travel.yahoo.com/p-travelguide
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden