Re: How to redraw a view in slow-motion
Re: How to redraw a view in slow-motion
- Subject: Re: How to redraw a view in slow-motion
- From: Matthias Arndt <email@hidden>
- Date: Mon, 20 Jun 2011 08:47:58 +0200
Hi Graham,
Am 20. Jun 2011 um 02:24 schrieb Graham Cox <email@hidden>:
> Your (4) is looking like the best approach - use a timer to schedule a periodic update of the view, and during that update, draw only some portion of the content on top of what you've drawn already. That leaves the issue of view resizing, which you'll need to take into account. You can get notified when the view is resizing, and modify your update schedule to ensure that it does what you want - typically, it will need to flag that the background needs to be erased and that the objects need to be redrawn from the beginning.
Thank you so much for this detailled reply: First I appreciate the confirmation, that threading is a bad idea for this purpose, and the encouragement to look into CoreAnimation in *future* apps ... I'll proceed with the 4th approach: For not too complex graphics the performance is good enough even if redrawing all pathes in each step, currently I'm looking into skipping the first (already drawn) ones.
Only drawing the delta, and reacting on resizes looks promising (thanks for the code fragments) ... another idea is to cache the last output in a bitmap, redraw it in the next iteration, and update the cache after resizing. But I'll look into this only if a simple redraw won't be sufficient: POITROAE :-)
Regards, Matthias
_______________________________________________
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