Texture.uploadFromByteArray() and BitmapData ARGB
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 ?
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 ?
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);
}
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.