开发者

Flash: Screenshot/save viewport image

开发者 https://www.devze.com 2023-02-05 16:46 出处:网络
Is there actionscript to enable a s开发者_JS百科creenshot of a specific area of the screen? And possibly display this screenshot at a different stage?You will need to use the BitmapData object to draw

Is there actionscript to enable a s开发者_JS百科creenshot of a specific area of the screen? And possibly display this screenshot at a different stage?


You will need to use the BitmapData object to draw the current pizels onto a new object. The code might look something like this...

//Assuming x,y,w,h is the area you want to capture
//Create a new bitmap data object to store our screen capture
var bmp:BitmapData = new BitmapData(h, w);

//Draw the stage onto our bitmap data clipping at the correct points
bmp.Draw(stage, null, null, null, new Rectangle(x, y, w, h));
0

精彩评论

暂无评论...
验证码 换一张
取 消