The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: UPucker on August 01, 2005, 10:24:46 PM

Title: Dibsection with more than 256 colors
Post by: UPucker on August 01, 2005, 10:24:46 PM
OK I know this is a stupid question, but.......

I can already setup a dibsection with 256 colors,

How do I setup a dibsection with more than 256 colors?

What is the format of each pixel?

Also on a side note, how do I make a dibsection fullscreen? Or switch to a fullscreen mode and draw on it with dib?

Title: Re: Dibsection with more than 256 colors
Post by: hutch-- on August 01, 2005, 11:50:15 PM
Hi UPucker,

Welcome on board. I moved your posting to the Campus so you would get more answers. The MASM32 subforum is for project related info.
Title: Re: Dibsection with more than 256 colors
Post by: UPucker on August 01, 2005, 11:58:16 PM
Thanks. I know the pixels in a 256-dib are 4 bytes, aarrggbb. I was just wondering if switching

mov canvas.bmiHeader.biBitCount,32

will increase the color depth, and if so what the pixel format is?

Anyone?

Title: Re: Dibsection with more than 256 colors
Post by: raymond on August 02, 2005, 03:13:23 AM
When you create a 256-color DIB, you have to provide a color table for those 256 colors, each color consisting of 4 bytes each. Each pixel is then only 1 byte which is the index for the color in the table.

For a 32-bit DIB, you do NOT supply a color table. Each pixel must then consist of 4 bytes, 3 of them for the RGB levels.

If you want to have a "full-screen" window, simply use the POPUP style.

Raymond
Title: Re: Dibsection with more than 256 colors
Post by: UPucker on August 02, 2005, 08:02:09 AM
Nevermind I figured it out. Thanks for the help.