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

Re: How to convert an NSBezierPath to an NSImage?


  • Subject: Re: How to convert an NSBezierPath to an NSImage?
  • From: Janek Priimann <email@hidden>
  • Date: Fri, 11 Apr 2003 20:39:51 +0300

> Hi,
>
> I am working on a little animation that moves different NSImage objects
> in a view. I have some other drawings made with NSBezierPath, and I
> would like to make NSImage of them to display them in my view with the
> other images. Is that possible?
>
> Thanks in advance,
>
> -- Arthur

Use the NSImage lockFocus/unlockFocus mechanism.

NSImage *myImage = [[NSImage allocWithZone:NULL] initWithSize:NSMakeSize(width, height)];

[myImage lockFocus];

// Draw(fill, stroke, clip) your bezier paths here

[myImage unlockFocus];

Links:

http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSImage.html#lockFocus
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSImage.html#unlockFocus

-----------------------------------------
Hot Mobiil - helinad, logod ja piltsunumid!
http://portal.hot.ee
_______________________________________________
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: 
 >How to convert an NSBezierPath to an NSImage? (From: Arthur VIGAN <email@hidden>)

  • Prev by Date: Re: NSTextView with 50% transparent background
  • Next by Date: object = [[Class alloc] init]
  • Previous by thread: How to convert an NSBezierPath to an NSImage?
  • Next by thread: Fwd: How to convert an NSBezierPath to an NSImage?
  • Index(es):
    • Date
    • Thread