• 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
Re: erasing, redrawing NSBezierPath into and NSImage problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: erasing, redrawing NSBezierPath into and NSImage problem


  • Subject: Re: erasing, redrawing NSBezierPath into and NSImage problem
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Mon, 5 Jul 2004 20:07:19 -0700

Hello...

Have you tried using NSRectFill() to erase the image?

After you lock focus on your image, use the NSRectFill() function to fill it with the "clear" color (uses the NSCompositeCopy compositing mode, which replaces the pixels with the new color).


NSRect imageRect;
imageRect.origin = (NSPoint){0.0f,0.0f};
imageRect.size = [yourImage size];

[[NSColor clearColor] set];
NSRectFill(imageRect);


Hope that helps,

Louis


When I resize the labelMatrix I want to resize/redraw these images. So, I want to clear the existing label images and draw a new correctly sized bezier path into them. This is my problem: I cannot find a way to clear the existing label images before I draw into them again. The images cannot be released because they are still being used by labelMatrix. I have managed to add to the existing images by drawing additional paths into them, but every attempt to clear the images first fails.

...

Will
_______________________________________________
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.


References: 
 >erasing, redrawing NSBezierPath into and NSImage problem (From: Wilhelm Phillips <email@hidden>)

  • Prev by Date: Re: Use different window than File Owner's in NIB
  • Next by Date: Implementing Hidden text
  • Previous by thread: erasing, redrawing NSBezierPath into and NSImage problem
  • Next by thread: Re: erasing, redrawing NSBezierPath into and NSImage problem
  • Index(es):
    • Date
    • Thread