AS3 で縦横比を維持しながら画像をスケーリングする必要があります。ステージ全体のサイズに合わせてスケーリングする必要がありますが、何も切り取ってはいけません。
どうやってするの?
ありがとう、ウリ
AS3 で縦横比を維持しながら画像をスケーリングする必要があります。ステージ全体のサイズに合わせてスケーリングする必要がありますが、何も切り取ってはいけません。
どうやってするの?
ありがとう、ウリ
このようなものが動作するはずです:
// set the scale to fit the width of the image to the width of the stage
var scale:Number = stage.stageWidth / myImage.width;
// if the height of the image will be taller than the stage,
// set the scale to fit the height of the image to the height of the stage
if(myImage.height * scale > stage.stageHeight){
scale = stage.stageHeight / myImage.height;
}
// apply the scale to the image
myImage.scaleX = myImage.scaleY = scale;