• 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: NSImage or NSBezierPath : what is the fastest ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage or NSBezierPath : what is the fastest ?


  • Subject: Re: NSImage or NSBezierPath : what is the fastest ?
  • From: Ricky Sharp <email@hidden>
  • Date: Wed, 3 Aug 2005 20:44:40 -0500


On Aug 3, 2005, at 11:12 AM, Eric Morand wrote:

I want to design my own control (button-like) and am wondering what is the most efficient way to draw it on th screen : compositing images (png format, created with photoshop) or using NSBezierPath ?


My control will use a flat design, so I can use NSImage or NSBezierPath to draw it. My only concern is efficiency.

In all my custom controls, I cache an NSImage (or images) which represent various states. Each control maintains a flag (needsCreateImages) which is initially set false. It is also set false in all setter methods which change visible attributes (e.g. strings, colors, base images). In my drawRect, drawInteriorWithFrame, etc. I call a createImages method if the flag is set true. Otherwise the draw is a simple "blit" of the cached image.


For my custom focus rings, I cache NSBezierPath objects.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
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


References: 
 >NSImage or NSBezierPath : what is the fastest ? (From: Eric Morand <email@hidden>)

  • Prev by Date: Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
  • Next by Date: Re: Bindings Sample code / Suggested reading
  • Previous by thread: Re: NSImage or NSBezierPath : what is the fastest ?
  • Next by thread: Re: NSNumberFormatter scientific notation
  • Index(es):
    • Date
    • Thread