Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 77806

Re: Pixel Tool in Flash CC?

$
0
0

this will get you started, or may all you want:

 

function pixellateF(mc:MovieClip,pixelSize:int=2):Bitmap{

    var bmpd:BitmapData = new BitmapData(mc.width,mc.height,true,0xffffff);

    bmpd.draw(mc);

    for(var xvar:int=1;xvar<=mc.width;xvar+=pixelSize){

        for(var yvar:int=1;yvar<mc.height;yvar+=pixelSize){

            var col:uint = bmpd.getPixel32(xvar,yvar);

            for(var xx:int=xvar;xx<xvar+pixelSize;xx++){

                for(var yy:int=yvar;yy<yvar+pixelSize;yy++){

                    bmpd.setPixel32(xx,yy,col);

                }

            }

        }

    }

return new Bitmap(bmpd);

}


Viewing all articles
Browse latest Browse all 77806

Trending Articles