You can download the BMPFunctions.as file in the following link.
클래스 파일은 아래 페이지에서 BMPFunctions.as를 다운로드하면 됩니다.
下のリンクのページで BMPFunctions.asファイルをダウンロードできます。
http://hangunsworld.com/classes/com/hangunsworld/as3/util/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import com.hangunsworld.as3.util.BMPFunctions; var bd:BitmapData = new BitmapData(mc.width, mc.height, true, 0×00000000); bd.draw(mc); var bmp:Bitmap = new Bitmap(bd); addChild(bmp); bmp.x = mc.width; // Replace Color button event listener replace_btn.addEventListener(MouseEvent.CLICK, doReplace); function doReplace(evt:MouseEvent):void{ var c1:uint = uint(“0x” + c1_txt.text); var c2:uint = uint(“0x” + c2_txt.text); var t:uint = Math.max(0, Math.min(255, uint(t_txt.text))); t_txt.text = t.toString(); // draws original image bd.draw(mc); // replaces colors bd = BMPFunctions.replaceColor(bd, c1, c2, t); } |
Recent Comments