Image.GetPixelFormatSize Method (PixelFormat)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Returns the color depth, in number of bits per pixel, of the specified pixel format.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public static int GetPixelFormatSize(
	PixelFormat pixfmt


Type: System.Drawing.Imaging.PixelFormat

The PixelFormat member that specifies the format for which to find the size.

Return Value

Type: System.Int32

The color depth of the specified pixel format.

.NET Framework
Available since 1.1
Return to top