Anthony Appleyard wrote: > I have written a program to handle graphics: I am familiar with the > modes bpp (= bits per pixel) 1 2 4 8 16 24. But when updating that > program for Windows Vista, I ran into a mode with bpp=32, four bytes > per pixel. The first three bytes would likely be red, green, blue, as > in bpp=24 mode; but what is the fourth byte? is it ignored, or > transparentness, or what?
It is the Alpha level with a valid range of 0-255. Actually, 32-bit images have been in use since Windows XP. That's how you get all those nifty non-jaggy icons on toolbars in, say, Microsoft Office. Or VerifyMyPC. Various icon programs call them "XP style icons" but an icon file is just a bunch of BMPs (and now PNGs under Vista) pasted together. Older OSes will actually read the 32-bit image but ignore the fourth byte (i.e. completely opaque usually with a black background). If you associate a mask, it will cause the black to go away but leave unsightly "jaggies" around the image. But at least the icon will appear properly. The only thing you can't make partially transparent is the window. Under XP, there are "layered windows" but transparency settings affect the whole window...not just parts of it. Under Vista with Aero, it may be possible to do partial window transparency. However, you shouldn't be rolling your own BMP file reader. Let a third-party toolkit such as ImageMagick do it for you. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
