screenshotslargeimage.mxml

来自「flex 实现的一个showcase 喜欢flex的朋友可以」· MXML 代码 · 共 45 行

MXML
45
字号
<?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[
			
			[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 + =
减小字号Ctrl + -
显示快捷键?