Created
August 17, 2012 23:07
-
-
Save blam23/3383359 to your computer and use it in GitHub Desktop.
Basic Blur BitmapData
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bmp:Bitmap; | |
var bmpdata:BitmapData; | |
var srect = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight); | |
var blurF:BlurFilter = new BlurFilter(3, 3, BitmapFilterQuality.LOW); | |
var colorT:ColorTransform = new ColorTransform(1.0, 1.0, 1.0, 0.9); | |
bmpdata = new BitmapData(0, 0, srect.width, srect.height); | |
bmp = new Bitmap(bmpdata); | |
addEventListener(Event.ENTER_FRAME, onFrame); | |
function onFrame(e:Event) { | |
bmpdata.applyFilter(bmpdata, srect, new Point(0, 0), blurF); | |
bmpdata.colorTransform(srect, colorT); | |
bmpdata.draw(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment