Hinweis: Dies gilt auch für die Anzeige der ursprünglichen Bildgröße ohne ObjectHandler-Steuerelement, entfernen Sie nur die Zeilen, die nicht anwendbar sind.
Nach Kampf Stunden für die Lösung, fand ich meine eigene Antwort durch in Actionscript Forum, in der Tat, nur eine Lösung, ich Überraschung gab es kein solches Thema an anderer Stelle.
private function init():void {
var image:Image = new Image();
image.source = "http://www.colorjack.com/software/media/circle.png";
image.addEventListener(Event.COMPLETE, imageLoaded);
/* wait for completion as Image control is asynchronous,
* which mean ObjectHandler will attempt to load asap
* and you are not able to get the correct dimension for scaling.
* EventListener fixed that.
*/
this.addChild(image);
//whenever you scale ObjectHandler control, the image is always fit by 100%
image.percentHeight = 100;
image.percentWidth = 100;
}
private function imageLoaded(e:Event):void{
var img:Image = e.target as Image;
trace("Height ", img.contentHeight);
trace("Width ", img.contentWidth);
var oh:ObjectHandles = new ObjectHandles();
oh.x = 200;
oh.y = 200;
oh.height = img.contentHeight;
oh.width = img.contentWidth;
oh.allowRotate = true;
oh.autoBringForward = true;
oh.addChild(img);
genericExamples.addChild(oh);
}
Wie erstellen Sie dieses neue Bild? Von einem Bitamp? – dirkgently