Hi,
I can't unserstand - how I can upload BitmapData.getPixels if uploadFromByteArray use BGRA colorspace and BitmapData.getPixels returns ARGB
What I should to do ?
Try getPixel32 which returns ARGB. Here's the link:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fla sh/display/BitmapData.html
That's just to BitmapData. You will find the method getPixel32 there.
Here is solution
var bm : BitmapData = new preview();
var outBm : BitmapData = new BitmapData(bm.width,bm.height,bm.transparent);
for ( var i : int = 0 ; i < bm.width; i ++ ) {
for ( var j : int = 0 ; j < bm.height; j ++ ) {
var BGR : uint = (bm.getPixel32(i,j) & 0x000000ff) << 16 | (bm.getPixel32(i,j) & 0x0000FF00) | (bm.getPixel32(i,j) & 0x00FF0000) >> 16;
outBm.setPixel32(i,j,BGR);
}
}
North America
Europe, Middle East and Africa
Asia Pacific