Flex上传图片等信息到数据库,并下载显示图片 下载本文

_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onBytesLoaded); }

private function onBytesLoaded(e:Event):void {

this.width = e.target.width; this.height = e.target.height; } } }

调用显示二进制图片,这里使用ByteArrayImage

Code

import mx.messaging.AbstractConsumer; import customComp.ByteArrayImage; import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent;

import mx.controls.Alert;

internal function onClick(evt:MouseEvent):void{ ManHuaService.GetOneManHuaTuPian(1,1,1); }

internal function GetOneManHuaTuPian_onResult(evt:ResultEvent):void{ var objManHuaTuPian:Object = evt.result; var arrImage:ByteArray = new ByteArray(); arrImage = objManHuaTuPian.TuPian; img.loadBytes(arrImage); } ]]>