Unfortunately, you may not be able to capture graphics generated by another domain unless that domain gives you permission.
-Alex On 5/26/14 12:10 AM, "wangjw" <[email protected]> wrote: >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(); >loader.addEventListener(Event.COMPLETE,finishCaptureUpload); >loader.load(urlrequest); > >+++++++++++++++++++++++++++++++++++++++++++++++++++++++ >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.
