Assigning the Color of a Region of Pixels : BitmapData : Graphics Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Graphics » BitmapData »

 

Assigning the Color of a Region of Pixels


 
   

package{
  import flash.display.*;
  import flash.utils.*;
  import flash.geom.*;
  public class Main extends Sprite{
    public function Main(){
        var imgData:BitmapData = new BitmapData(44, false, 0xFFFF0000);
        
        var byteArray:ByteArray = new ByteArray(  );
        byteArray.writeUnsignedInt(0xFF00FF00);
        
        byteArray.position = 0;
        
        imgData.setPixels(new Rectangle(1,0,3,2), byteArray);

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Graphics
» BitmapData