• 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: NSBezierPath to NSImage?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBezierPath to NSImage?


  • Subject: Re: NSBezierPath to NSImage?
  • From: "John C. Randolph" <email@hidden>
  • Date: Tue, 30 Apr 2002 14:42:56 -0700

On Monday, April 29, 2002, at 08:45 PM, Michael Briscoe wrote:

Hello List!

This is probably a stupid question, but it's driving me nuts! Is there a way to draw NSBezierPath's directly to an NSImage?

Of course.

I need this so that I can render the NSBezierPath data as a bitmap, and use composite operations in my NSView.

Here's an except of my code:

theImage = [[NSImage alloc] initWithSize:NSMakeSize(theSize, theSize)];

[theImage lockFocus];
[self drawShape]; // bezier path drawing routines
[theImage unlockFocus];

This doesn't seem to be working.

You're not showing us enough code here to see what's going wrong. What does -drawShape do? Are you sure that your path lies entirely within the borders of the image? What's the current color when you stroke or fill the path? What's the background color, etc?

-jcr


John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSBezierPath to NSImage?
      • From: Michael Briscoe <email@hidden>
References: 
 >NSBezierPath to NSImage? (From: Michael Briscoe <email@hidden>)

  • Prev by Date: C Library and Cocoa
  • Next by Date: Crash saving to NSUserDefaults
  • Previous by thread: NSBezierPath to NSImage?
  • Next by thread: Re: NSBezierPath to NSImage?
  • Index(es):
    • Date
    • Thread