//保存图片到本地
private function downloadPicture():void{
var myData:BitmapData=new BitmapData(this.graphCnvs.width,this.graphCnvs.height);
myData.draw(this.graphCnvs);
downloadFile(myData);
}
public function downloadFile(myData:BitmapData):void{
file=new FileReference();
file.addEventListener(Event.COMPLETE,downloadComplete);
file.save(new JPEGEncoder(80).encode(myData),"graph.jpg");
}
private function downloadComplete(event:Event):void{
//Alert.show("成功保存图片到本地!","提示");
}
阅读(1952) | 评论(0) | 转发(0) |