Christoffer Sørensen wrote:
> On Tue, Aug 5, 2008 at 9:54 PM, Christopher Barker
>> This makes for a slight delay, which is unnecessary for images that are
>> fast to draw, but allows it to work OK with images that take a while to
>> draw.
> 
> Thanks for looking into this. However, ideally the canvas should
> update as I drag and not flicker in any way.

ideals are nice!

> I can see why this is
> difficult to implement: if you have many objects you have to draw them
> all and then move your viewport along; this would take a long time to
> draw initially but moves would be fluent.

The initial draw time isn't the issue -- the issue is how big the buffer 
is. We can't draw EVERYTHING every time -- when you are zoomed in close, 
that would require a massive buffer, and not be possible.


What you could do is have the buffer be larger than the visible window, 
then you could drag it fast. You could do the whole thing by having the 
buffer be 9 times as large as the window. let's see:

1000*1000 window * 9 * 3 byte/pixel = about 26 MB -- that's a pretty big 
off screen buffer, but might be doable these days. In fact, I don't 
think the memory is too much of an issue with systems having 1GB of 
memory routinely, but pushing 26 MB in and out of memory is kind of slow.

It would also take some changes in probably quite a few places in the 
code. Nothing too hard, but it would be fiddly

Another option would be tiles, I suppose.

> This is very much the same case as for scrollbars. Your viewport is
> smaller than your drawing. (I wouldn't know how to create a viewport
> that only looked at a section of a drawing).

I'm confused -- that's exactly what is happening now -- the viewport is 
only looking at part of the drawing.

> How Kiva does it, I'm not sure.

Neither am I. I'd be nice to find out. Are you sure is can do it 
virtually instantaneously for complex drawings?

As for your app, if your drawing is pretty simple, then you can use the 
code I posted earlier, and all is well.

-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

[EMAIL PROTECTED]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to