flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wangjw <campol...@gmail.com>
Subject HI,everybody,When i use BitmapData.draw ,I have a question
Date Mon, 26 May 2014 07:10:52 GMT
I have a quest,I want to save the mapcontrol(arcgis map control) to a
Image,Then send the Image to the webserver.
below the is code:
var width:Number  = map.width;
var height:Number  = map.height;
var bitmapData:BitmapData = new BitmapData(width, height);
bitmapData.draw(mapcontainer,new Matrix());	

var file:FileReference = new FileReference();
var jpg:JPEGEncoder = new JPEGEncoder();
var ba:ByteArray = jpg.encode(bitmapData);

var urlrequest: URLRequest = new URLRequest(uploadImgUrl + "?id="+appId);
urlrequest.method = URLRequestMethod.POST;
urlrequest.data = ba;
urlrequest.contentType = "application/octet-stream";
var loader:URLLoader = new URLLoader();

When in the flash builder test mode,the code is no problem,
But when I run the swf  in  a webserver,
	bitmapData.draw(mapcontainer,new Matrix());
this line of code can't run.
I have corssdomain.xml ,but it no use.Can anybody help me ?
the reason is flex security sandbox? but i don't konw how to set.

View raw message