bitmapdatatest3
/**
* Copyright k2syndrome_g ( http://wonderfl.net/user/k2syndrome_g )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/dNxz
*/
// forked from k2syndrome_g's bitmapdatatest2
// forked from k2syndrome_g's bitmapdatatest1
package {
import flash.display.Shape;
import flash.geom.Point;
import flash.geom.Matrix;
import flash.text.TextFormat;
import flash.text.TextField;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
var tf:TextField=new TextField();
tf.defaultTextFormat=new TextFormat("",60,0x0,true);
tf.text="Actionscript";
tf.autoSize="left";
var alphabd:BitmapData=new BitmapData(tf.width,tf.height,true,0x0);
alphabd.draw(tf);
//
var matrix:Matrix=new Matrix();
matrix.createGradientBox(tf.width,tf.height,45*Math.PI/180);
var gradation:Shape=new Shape();
gradation.graphics.beginGradientFill("linear",[0xFF0000,0x00FF00,0x0000FF],[1.0,1.0,1.0],[0,128,255],matrix);
gradation.graphics.drawRect(0,0,tf.width,tf.height);
gradation.graphics.endFill();
var bd:BitmapData=new BitmapData(gradation.width,gradation.height,true,0x0);
bd.draw(gradation);
bd.copyPixels(bd,bd.rect,new Point(),alphabd,new Point());
//
var bitmap:Bitmap=new Bitmap(bd);
addChild(bitmap);
}
}
}