开发者

Save cropped image from custom shape mask action script 3

开发者 https://www.devze.com 2023-03-10 17:24 出处:网络
I\'ve managed to draw a custom shape onto a canvas and use that shape as a mask over an image. Is there anyway possible to crop the image and save it out in the custom shape? making whatever is outsid

I've managed to draw a custom shape onto a canvas and use that shape as a mask over an image. Is there anyway possible to crop the image and save it out in the custom shape? making whatever is outside the shape transparent? The only image cropping i can find is using rectangles, whereas i need a poly开发者_开发技巧gon shape....

Any help would be much appreciated. And thanks in advance!


first you need this: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/BitmapData.html#draw()

second you should set it up like a movieclip with the image inside and mask the movieclip ([MovieClip].mask) with a shape, or whateve then parse it to the draw method of a new bitmap data.

you can capture anything like this that can be rendered inside flash.

0

精彩评论

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

关注公众号