日期:2014-05-17 浏览次数:20706 次
public function getJPGByteArray(target:UIComponent):ByteArray {
var bitmapData : BitmapData = new BitmapData(target.width, target.height);
bitmapData.draw(target);
var jpg : JPGEncoder = new JPGEncoder();
var jpgByteArray : ByteArray = jpg.encode(bitmapData);
return jpgByteArray;
}
public function sendImageByte(target:UIComponent):void {
var urlStr:String="/yffb/System/Login/toWord?out_fileName=lineChart&fn=总体走势判断模块&content="+(model.warmessage);
trace(encodeURIComponent("--------------------------"+model.warmessage));
var request:URLRequest = new URLRequest(encodeURI(urlStr));
request.contentType = 'applicatoin/octet-stream';
request.data = getJPGByteArray(target);
request.method = URLRequestMethod.POST;
navigateToURL(request, "_blank");
}