Jump to content

Jonathan Green

Newbies
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Jonathan Green

  1. My image is set up ready to create a Texture in OpenGL, and that needs RGBA order. To write the BMP file in BGRA order I would have to swizzle all the data. Not a big deal, but it seemed like it shouldn't be necessary as the DIB header supports a quite generic setup using the alpha masks. I guess WIC doesn't support the format generally. Seems odd that it reads the colors ok, but just ignores the alpha channel with RGBA and not in BGRA. Thanks anyway. I'll have to just swizzle the data.
  2. I'm writing a BMP file from my app and trying to open it in .Net (4.2.13). I'm using the same DIB header format as is written by .Net (BITMAPV5HEADER). .Net specifies the RGBA channel masks in the header as R = 0x00ff000, G = 0x0000ff00, B = 0x000000ff, A = 0xff000000. When I write these masks to my header, .Net reads the file correctly, but my pixel data is in a different order, the red and blue colors are swapped. But the alpha channel is correct. If I change the header mask to get the correct color order [R = 0x0000000ff, B = 0x00ff0000], the colors come in the correctly, but the alpha channel data is ignored and all pixels have alpha 255. I can read my correct order BMP file into InkScape and it works fine, with the alpha channel correct. So this seems to be a .Net bug. I'm using all the other settings exactly as written by .Net, so DIB header bV5Compression is 3 (BI_BITFIELDS). If I hand edit a BMP file written by .Net to just swap the red and blue masks the same thing happens. When I open the edited BMP file in .Net, the alpha channel data is ignored and all texels have alpha = 255.
×
×
  • Create New...