• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
lockFocus clearing current color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lockFocus clearing current color


  • Subject: lockFocus clearing current color
  • From: Jonathon Mah <email@hidden>
  • Date: Sun, 17 Apr 2005 01:51:57 +0930

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


  • Prev by Date: Re: Short Date Format for NSCalendarDate in bound NSTableColumn
  • Next by Date: Re: Short Date Format for NSCalendarDate in bound NSTableColumn
  • Previous by thread: Re: Short Date Format for NSCalendarDate in bound NSTableColumn
  • Next by thread: Re: lockFocus clearing current color
  • Index(es):
    • Date
    • Thread