On Mon, Feb 10, 2014 at 2:10 PM, Nouvelle Collection <
[email protected]> wrote:

> Sorry for not having answered about this sooner. Thank you very much
> Chris, now it's easy to change quality settings !
>
> One last thing about this subject : when you resize, you can see that (but
> it goes very fast):
> * all items are rescaled and repositionned "one by one" (producing
> sometimes little "jumps" for little elements that "jump" from 4 to 5
> pixels, and their neighboor don't "jump" at  the same time)
>
>
That shouldn't be happening -- when the Canvas is re-drawn, it is drawn to
an off-screen bitmap, starting from a blank bitmap. The bitmap is then
drawn to the screen when it's ready -- tehre should be no visual effect of
the individual items be drawn or re-scaled, or any of that. If there are a
lot of objects, then the bufer is blitted to the screen every once in a
while (every 500 objects, I think), so the user can see that something is
going on if the drawing is slow.

So I'm not sure what you are seeing.....

Would it possible (or did you try this in an older version of
> FloatCanvas?)  to have :
> 1) there is a "full size Bitmap buffer" (for example 1000x800), and all
> elements are only put here *once* when Added to the canvas
> 2) When you resize the canvas or ZoomToBB(), this *whole Bitmap* buffer
> would be rescaled, and redrawed. This would prevent to rescale / reposition
> all items *one by one*.
> Have you already tried this ?
>

That wouldn't be very scalable -- when you zoom in close, the size of the
"virtual" buffer could be absolutely huge! Now that memory is relatively
large, I've thought about having an off-screen buffer that was bigger than
the current Window -- it would allow things like panning, etc to be really
nice an fast. But it would be a lot of book keeping, for I don't think much
gain.

-Chris






>
> All the best, J
>
>
> 2014-02-05 18:41 GMT+01:00 Chris Barker <[email protected]>:
>
>> On Tue, Feb 4, 2014 at 9:03 AM, Nouvelle Collection <
>> [email protected]> wrote:
>>
>>> Thanks for your solution, it works now !
>>> I still keep the CallLater(1, self.Canvas.ZoomToBB)  because it's
>>> better to wait before zooming, you're right.
>>> (By the way would you use CallLater or CallAfter ? It seems that I
>>> used both without even thinking I was using 2 different things!)
>>>
>>
>>
>> CallAfter() puts an event on the event stack right away, that will be
>> executed as soon as the existing events are processed -- i.e. as soon as
>> possible.
>>
>> CallLater() allows you to specify a time delay before the event is
>> processed. I suppose CallLater with a very short time is essentially the
>> same, but may produce a tiny bit of overhead setting up a timer. But the
>> real reson to use CallAfter() rather than CallLater() is so that the intent
>> is clear.
>>
>>  Another thing : is it possible to have a better image rendering with
>>
>>> "AddScaledBitmap" ?
>>>
>>> I don't exactly remember where, but I have once used something like
>>> wx.IMAGE_QUALITY_HIGH in StaticBitmap or DrawBitmap, and the quality
>>> of the resizing was greatly improved (the image was smoother, less
>>> aliasing).
>>>
>>> Is this possible in FloatCanvas ?
>>>
>>
>> It wasn't but it is now. The quality setting was hard-coded in. I"ve
>> enclsoed an updated version (also in SVN that allows you to set the Quality
>> flag:
>>
>>         img1 = self.Canvas.AddScaledBitmap(bmp1, (0, 0), Height =
>> bmp1.GetHeight(), Position = 'tl', Quality='normal')
>>         img2 = self.Canvas.AddScaledBitmap2(bmp2, (100, -100), Height =
>> bmp2.GetHeight(), Position = 'tl', Quality='high')
>>
>> you can also set it after the fact:
>>
>> img2.Quality = 'high'
>>
>> -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://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
>>
>>
>
> _______________________________________________
> FloatCanvas mailing list
> [email protected]
> http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
>
>


-- 

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://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to