This content has been marked as final. Show 3 replies
Either set the autoLayout attribute of VBox to false or change the VBox into a Canvas.
VBox will try to position the object without considering the angle it's rotated at. That makes it disappear.
Thanks for a quick response. I did something simillar before (using the Canvas instead of the VBox) your suggestions fix the scrolling issue but it still does not work the way it should. If the rotation is 0 then the scroll bars "fit" the image (So you don't go out and see any white space). If the rotation is say 90 than it doesn't allow the image at full height, little bit of the page and no scroll bar to move down, also it gives you a lot of room to move to the side event though you can already see the image at full width. It's event worse when you do 180 deg rotation. Do you think this is something that is achievable (to have scroll bars that fit the image regardles of the rotation) ? Thanks
<!-- <mx:VBox id="vb" x="10" y="10" height="604" width="776" autoLayout="false"> -->
<mx:Canvas x="10" y="10" width="776" height="604" autoLayout="false">
<mx:source>file:///C|/Documents and Settings/All Users/Documents/My Pictures/Sample Pictures/Winter.jpg</mx:source>
<!-- </mx:VBox> -->
You'd have to extend the Image control and implement your measure() function by taking the rotation into account as well so that width / height of the component is reported differently than what it actually is based on the angle.
For some info on this, take a look at TiltingPane.as in Ely's DisplayShelf Component. TiltingPane is for rotation in the Z direction, but it's principle can be applied in your case.