📄 screenshotslargeimage.mxml
字号:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
width="207" height="172"
horizontalScrollPolicy="off"
verticalScrollPolicy="off">
<mx:Script>
<![CDATA[
/////////////////////////////////////////////////////////////////////////////////////////
//public variables
[Bindable]
public var imageURL:String;
/////////////////////////////////////////////////////////////////////////////////////////
private function handleLoadComplete(event:Event):void{
Bitmap(event.target.content).smoothing = true;
var image:DisplayObject = this.imageLoader_mc.content;
var wratio:Number=205/this.imageLoader_mc.contentWidth
this.imageLoader_mc.width=this.imageLoader_mc.contentWidth*wratio
this.imageLoader_mc.height=this.imageLoader_mc.contentHeight*wratio
//checkto see if the height is too small now, if it is, resize based on height to make it fit
if(this.imageLoader_mc.height<170){
var hratio:Number=170/this.imageLoader_mc.contentHeight
this.imageLoader_mc.width=this.imageLoader_mc.contentWidth*hratio
this.imageLoader_mc.height=this.imageLoader_mc.contentHeight*hratio
}
}
public function removeImage():void {
this.imageLoader_mc.source = null;
}
]]>
</mx:Script>
<mx:Canvas id="imageHolder_mc" width="205" height="170" x="1" y="1"
horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:SWFLoader id="imageLoader_mc" source="{this.imageURL}" complete="this.handleLoadComplete(event)"
width="400" height="400"/>
</mx:Canvas>
<mx:Image source="@Embed('/assets/images/screenshots_largeImage_outline.png')"/>
</mx:Canvas>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -