FROM : Jim Thomason
DATE : Tue Dec 21 17:16:30 2004
There's no magic to it. Just use an appropriate offscreen item and
draw into that. an NSView that's not visible, or an NSImage, or
whatever else would be appropriate to you. You can then composite in
the whole thing.
BUT - before you go off doing that, I hope you ensure that there
aren't other ways to optimize your drawing. For example, if only a
small section of the view is changing, you'll see good performance
boosts by only re-darwing that section instead of the whole thing.
If you're constantly re-drawing your entire view into the offscreen
buffer, you won't see any performance improvement since you're still
re-drawing everything.
The only time I've successfully used offscreen buffers (not saying
it's the only time to use it, just the only time I have) is when
moving around a large image inside my view. I construct the entire
image offscreen then only draw in the visible bits. But unless you're
writing a game (I was), using an NSScrollView for that would probably
be more appropriate.
On Tue, 21 Dec 2004 15:43:55 +0000, Miguel Arroz <<email_removed>> wrote:
> Hello!
>
> I have some NSView subclasses that are becoming really slow to
> re-draw due to the large ammount of text and graphics contained in
> them. So, I would like to draw to an offscreen buffer, and use that
> buffer for the redraws. The problem is that I still could not find a
> way to create an offscreen buffer in Cocoa. This probably a
> "go-look-in-the-FAQ" kind of question, but if you could help me on
> this... :-)
>
> Yours
>
> Miguel Arroz
>
> "GUERRA E' PAZ
> LIBERDADE E' ESCRAVIDAO
> IGNORANCIA E' FORCA" -- 1984
>
> Miguel Arroz - <email_removed> - http://guiamac.com/bagos
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
DATE : Tue Dec 21 17:16:30 2004
There's no magic to it. Just use an appropriate offscreen item and
draw into that. an NSView that's not visible, or an NSImage, or
whatever else would be appropriate to you. You can then composite in
the whole thing.
BUT - before you go off doing that, I hope you ensure that there
aren't other ways to optimize your drawing. For example, if only a
small section of the view is changing, you'll see good performance
boosts by only re-darwing that section instead of the whole thing.
If you're constantly re-drawing your entire view into the offscreen
buffer, you won't see any performance improvement since you're still
re-drawing everything.
The only time I've successfully used offscreen buffers (not saying
it's the only time to use it, just the only time I have) is when
moving around a large image inside my view. I construct the entire
image offscreen then only draw in the visible bits. But unless you're
writing a game (I was), using an NSScrollView for that would probably
be more appropriate.
On Tue, 21 Dec 2004 15:43:55 +0000, Miguel Arroz <<email_removed>> wrote:
> Hello!
>
> I have some NSView subclasses that are becoming really slow to
> re-draw due to the large ammount of text and graphics contained in
> them. So, I would like to draw to an offscreen buffer, and use that
> buffer for the redraws. The problem is that I still could not find a
> way to create an offscreen buffer in Cocoa. This probably a
> "go-look-in-the-FAQ" kind of question, but if you could help me on
> this... :-)
>
> Yours
>
> Miguel Arroz
>
> "GUERRA E' PAZ
> LIBERDADE E' ESCRAVIDAO
> IGNORANCIA E' FORCA" -- 1984
>
> Miguel Arroz - <email_removed> - http://guiamac.com/bagos
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
| Related mails | Author | Date |
|---|---|---|
| Miguel Arroz | Dec 21, 16:43 | |
| Jim Thomason | Dec 21, 17:16 | |
| Miguel Arroz | Dec 21, 18:28 | |
| paul webb | Dec 21, 19:17 | |
| Markus Hitter | Dec 21, 19:34 |






Cocoa mail archive

