
Код AS3:
var tmpSh:Shape = new Shape();
tmpSh.graphics.beginFill(0xFF00FF, 1);
tmpSh.graphics.drawRect(5, 5, 20, 20);// drawPath(commands, data);
tmpSh.graphics.endFill();
var pixelValue:uint, pixelValueMask:uint, i:int = 0, j:int = 0;
var bmpdata:BitmapData = new BitmapData(tmpSh.width, tmpSh.height, false, 0xFF0000);
bmpdata.draw(tmpSh);
var arr:Vector.<String> = new Vector.<String>();
for (i = 0; i < tmpSh.width-1; i++) {
for (j = 0; j < tmpSh.height-1; j++) {
pixelValue = bmpdata.getPixel(i, j);
if (arr.length == 0 || arr.indexOf(("0x"+pixelValue.toString(16))) < 0) arr.push("0x"+ pixelValue.toString(16));
}
}
trace(arr); // 0xff0000,0xff00ff