Which one would you use to draw stuff on a winform? Format32bppRgb or Format24bppRgb or something else?

in any .net version

Format24bppRgb
Specifies that the format is 24 bits per pixel; 8 bits each are used for the red, green, and blue components.

Format32bppRgb
Specifies that the format is 32 bits per pixel; 8 bits each are used for the red, green, and blue components. The remaining 8 bits are not used.

      

+1


source to share


2 answers


From what I can tell, due to the documentation, if you are going to choose between these two, there is no point in going with 32. However, my gut tells me that if you are only building for desktop applications and you want the best possible range of colors for those who have 32 bit color I would use either Format32bppArgb

, or Format32bppPArgb

according to the MSDN documentation they are going to provide more bits for storing colors.



0


source


As you pointed out from the documentation, Format32bppRgb will use the same 24 bits per pixel and the remaining 8 bits won't be used, so why would you go with Format32bppRgb if it only kills the bits. It probably only exists for compatibility reasons. Format32bpp A rgb, however, uses an extra 8 bits for the alpha channel. So between these options, you should use Format32bppArgb if you want an alpha channel or Format24bppRgb otherwise.



Are you using Bitmap to draw something WinForm? If you are using graphics to draw on a bitmap only to display the bitmap, you can also use graphics to draw directly in the control. You can wrap Graphics around any control or form using Graphics.From(control.Handle)

.

0


source







All Articles