In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Vectorを使用したビットマップ塗りつぶしのテスト

Get Adobe Flash player
by TheCoolMuseum 06 Aug 2009
/**
 * Copyright TheCoolMuseum ( http://wonderfl.net/user/TheCoolMuseum )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/jd64
 */

//
package {
    import flash.display.*;
    import flash.geom.*;
    
    public class FlashTest extends Sprite {
        private var iWidth:int = 480;
        private var iHeight:int = 480;
        
        public function FlashTest() {
              var bmd:BitmapData = new BitmapData(iWidth, iHeight, true);
              //var img:Vector.<uint> = new Vector.<uint>(iWidth*iHeight, true);
              var img:Vector.<uint> = new Vector.<uint>();
              for(var i:int=0; i<1; i++){ //1回描画 テスト用
                  for(var y:int=0; y<iHeight; y++){
                      var r:uint = int(y/iHeight*256)<<16;
                      var pos:int = y*iWidth;
                      for(var x:int=0; x<iWidth; x++){
                          img[pos+x] = (0xff000000)+(r)+(int(x/iWidth*256)<<8)+0x00
                      }
                  }
              }
              bmd.setVector(bmd.rect, img);

              addChild(new Bitmap(bmd));
        }
    }
}