[flexcoders] Re: Canvas zoom / preview / Navigator

2007-01-02 Thread ecpmaz
I did what I said before to accomplish what I wanted :
- BitmapData.draw to get a bitmap containing my Canvas snapshot
- UIComponent.scaleX/Y to zoom...

I commented my sources if anyone is interested in using it.
eaurizon.org/labs_maz/AdvancedCanvas/src.zip
The package contains :
- AdvancedCanvas : the canvas with zoom+drag enabled
- AdvancedCanvasNavigator : the thumbnail
- SampleMain : a sample

The sample is also visible at eaurizon.org/labs_maz/AdvancedCanvas/
:)

Mathieu LEMAIRE



Re: [flexcoders] Re: Canvas zoom / preview / Navigator

2006-12-21 Thread Doug McCune
Regarding generating the snapshot or thumbnail drawing... Sorry if 
this isn't incredibly helpful, but I'd start with understanding 
BitmapData stuff. To do the snapshot I'm guessing you're going to want 
to capture the BitmapData of the Canvas (and that will include all the 
components it contains) and then resize and redraw that in your 
thumbnail component.


Maybe this link will help: 
http://www.cynergysystems.com/blogs/page/andrewtrice?entry=realtime_thumbnails_of_flex_uicomponents
here's another one from the same guy's blog: 
http://www.cynergysystems.com/blogs/page/andrewtrice?entry=flex_2_bitmapdata_tricks_and


I'm not entirely sure what happens if you try to get the bitmapData 
object from a canvas that uses clipping. I'm guessing you'll want to 
have one inner container component that doesn't clip the content, then 
you'll want to get the bitmapData of that component, not the outer 
Canvas. Hopefully bitmapData will return the entire bitmapData of a 
container, even if not all of that container is visible on the screen. 
Can anyone confirm this? I'm too lazy to try it out right now.


Doug


ecpmaz wrote:


Thank you for your code, but I do not simply work with pictures but
with an entire canvas filled with various components (textinputs,
buttons, pictures...etc)

Mathieu LEMAIRE

 




[flexcoders] Re: Canvas zoom / preview / Navigator

2006-12-21 Thread ecpmaz
Yes that is exactly what I needed ! I will come back to you when I
will have solved that clipping issue.

For the zoom feature, I just found a property of the Canvas : scaleX,
scaleY... looks pretty much what I was looking for !

Mathieu LEMAIRE