flash on 2009-5-16
♥0 |
Line 44 |
Modified 2009-05-16 23:00:08 |
MIT License
archived:2017-03-20 06:39:58
ActionScript3 source code
/**
* Copyright kohie_yamashima ( http://wonderfl.net/user/kohie_yamashima )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/h74D
*/
package
{
import flash.display.*;
import flash.events.*;
import flash.filters.ConvolutionFilter;
import flash.geom.*;
import flash.text.*;
[SWF( width="465", height="465", backgroundColor="0x000000", frameRate="30" )]
public class Main extends Sprite
{
private var _srcBmd:BitmapData;
private var _dstBmd:BitmapData;
private var _canvas:Bitmap;
private var _point:Point;
private var _filter:ConvolutionFilter;
private var _isStarted:Boolean = false;
public function Main():void
{
addEventListener(Event.ADDED_TO_STAGE, addedHandler);
}
private function addedHandler(event:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, addedHandler);
init();
}
private function init():void
{
_point = new Point();
_filter = new ConvolutionFilter(3, 3, [0,1,0,1,1,1,0,1,0],5,0,true);
_srcBmd = new BitmapData(465, 465, false, 0x000000);
var textField:TextField = new TextField();
textField.autoSize = TextFieldAutoSize.LEFT;
var textFormat:TextFormat = new TextFormat(null, 30, 0xffffff, true);
textField.defaultTextFormat = textFormat;
textField.text = "Hello Wonderfl!!";
_srcBmd.draw(textField, new Matrix(1, 0, 0, 1, 230, 210), null, null, null, true);
_dstBmd = new BitmapData(_srcBmd.width, _srcBmd.height);
_dstBmd.draw(_srcBmd);
_canvas = new Bitmap(_dstBmd);
_canvas.smoothing = true;
addChild(_canvas);
}
}
}