Raccord Flex Image en Toile

Comment puis-je l'échelle une Image en Flex pour s'adapter à une Toile? Mon code suit:

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
         horizontalAlign="center"
         width="100" height="100"
         verticalGap="0" borderStyle="solid"
         initialize="onLoad()"
         horizontalScrollPolicy="off"
         verticalScrollPolicy="off">
    <mx:Canvas width="100%" height="100%" id="PictureBox" horizontalScrollPolicy="off"
         verticalScrollPolicy="off" />
    <mx:Label id="NameLabel" height="20%" width="100%"/>
    <mx:Script>
        <![CDATA[
        private function onLoad():void
        {
            var image:SmoothImage = data.thumbnail;

            image.percentHeight = 100;
            image.percentWidth = 100;
            this.PictureBox.addChild(image);

            var sizeString:String = new String();

            if ((data.fr.size /1024) >= 512)
                sizeString = "" + int((data.fr.size /1024 /1024) * 100)/100 + " MB";
            else
                sizeString = "" + int((data.fr.size /1024) * 100)/100 + " KB";

            this.NameLabel.text = data.name + " \n" + sizeString;

        }
        ]]>
        </mx:Script>
</mx:VBox>

Je suis en train d'essayer d'obtenir l'image:SmoothImage dans PictureBox et de mise à l'échelle vers le bas.

Note SmoothImage dérive de l'Image.

  • Ce n'SmoothImage en dérivent? De l'Image?
  • Oui, c'est juste définit la propriété lisse.
  • Certains comment les propriétés scalex et scaley travail. Je ne connais pas les maths j'ai besoin maintenant.