Trouble with drawing, I need some ideas :)

Robin Dunn wrote:

The key point is to draw the expensive things as few times as possible,
and that means drawing them to a bitmap and then just blitting thhe
bitmap.

This is exactly what FloatCanvas does -- you can put objects on the
background (the default), or the foreground. When something changes on
the foreground,the background is blitted, then the foreground objects
are re-drawn. This works well, as usually, there are only a few things
that are changing.

You may want to give FloatCanvas a try -- this is all done for you
already. It's not using GraphicsContext now, but you can write your own
DrawObjects that do use GraphicsContext if you want. Someone's put a
Wiki page up about this:

http://morticia.cs.dal.ca/FloatCanvas/wiki/SmoothLines

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

This is my problem Chris… the “expensive” layer is the foreground layer… what I’m trying to avoid is the recomputing of the foreground layer NOT of the background!

to give you an idea… imagine that you have a ton of foreground objects that ALL need to be recomputed and redrawn on the smallest change in the background.

Also… anti-alias is required and one of the reasons the “expensive” objects are expensive :wink:

Peter.

···

On 9/28/07, Chris.Barker@noaa.gov Chris.Barker@noaa.gov wrote:

When something changes on
the foreground,the background is blitted, then the foreground objects

are re-drawn. This works well, as usually, there are only a few things
that are changing.


There is NO FATE, we are the creators.