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(4, 4, false, 0xFFFF0000);
var byteArray:ByteArray = new ByteArray( );
byteArray.writeUnsignedInt(0xFF00FF00);
byteArray.position = 0;
imgData.setPixels(new Rectangle(1,0,3,2), byteArray);
}
}
}
Related examples in the same category