• 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: Faster alternative to NSImage draw/composite?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faster alternative to NSImage draw/composite?


  • Subject: Re: Faster alternative to NSImage draw/composite?
  • From: Joseph Heck <email@hidden>
  • Date: Sat, 02 Aug 2008 15:13:44 -0700

I've been doing exactly this recently, and have had excellent success with using CALayers (Core Animation). An NSTimer with a fast repeat rate is triggering a method that assigns in one of an array of CGImageRef's to the layer's contents property has made for a really decent "flipbook" style of animation. I've been able to get 60 frames per second without issue.

I believe you can load up the CGImageRef's from NSImage through CGBitmapContext and CGBitmapContextCreateImage. I've been working with a *cough* different framework to get the images and display them - one that's significantly less powerful than a standard Mac desktop - but the throughput has been effectively the same.

-joe

On Aug 2, 2008, at 3:01 PM, Charles Steinman wrote:
--- On Sat, 8/2/08, Matt R <email@hidden> wrote:

I have read through Apple's drawing optimization guide
and have been
searching for a way of speeding these operations up, they
are unacceptably
slow. I have several 72dpi PNG image files (about 1024x768
each) which I
need to draw repeatedly into a standard NSView subclass
over time. I would
like to avoid using OpenGL directly if possible, it seems
like there should
be a faster way of drawing these other than NSImage's
draw or composite
methods.

You might try a CGLayer. It's designed for fast repeated drawing.

Cheers,
Chuck

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Faster alternative to NSImage draw/composite?
      • From: John Harper <email@hidden>
References: 
 >Re: Faster alternative to NSImage draw/composite? (From: Charles Steinman <email@hidden>)

  • Prev by Date: Re: Faster alternative to NSImage draw/composite?
  • Next by Date: Re: reloading an NSTreeController
  • Previous by thread: Re: Faster alternative to NSImage draw/composite?
  • Next by thread: Re: Faster alternative to NSImage draw/composite?
  • Index(es):
    • Date
    • Thread