Re: Drawing faster with NSImage???
Re: Drawing faster with NSImage???
- Subject: Re: Drawing faster with NSImage???
- From: Nat! <email@hidden>
- Date: Mon, 17 Dec 2001 21:40:38 +0100
On Montag, Dezember 17, 2001, at 08:41 Uhr, Joshua D. Orr wrote:
>
I have a app that does a lot of drawing. I have been thinking if
>
I draw to
>
an NSImage and then when they scroll around, the just scroll around the
>
NSImage. When they change something I could recalculate the
>
NSImage. I am
>
trying to find the best way to do this, does anyone have any
>
suggestions?
You could make your drawing code a subclass of NSImageRep (not
NSBitmapImageRep I suppose) and do your drawing there. The NSImage
that owns that imageRep will automatically cache the drawing for
you. You may need to recache the NSImage (throw away the cache),
when something changed.
Cheers
Nat!
-----------------------------------------------------
Some people drink deep from the fountains of life, and
some just gargle. -- DLR