Skip to main content

PixelFormat

Namespace: System.Drawing.Imaging

Assembly: System.Drawing.Managed (4.0.0.0)

Specifies the format of the color data for each pixel in the image.

public enum PixelFormat : Enum

Fields

NameDescription
AlphaSpecifies that pixel data contains alpha values that are not pre-multiplied.
CanonicalThe default pixel format of 32 bits per pixel. The format specifies 24-bit color depth and an 8-bit alpha channel.
DontCareSpecifies that pixel format is a don't care.
ExtendedReserved.
Format16bppArgb1555Specifies that pixel format is 16 bits per pixel. The color information specifies 32768 shades of color of which 5 bits are red, 5 bits are green, 5 bits are blue and 1 bit is alpha.
Format16bppGrayScaleThe pixel format is 16 bits per pixel. The color information specifies 65536 shades of gray.
Format16bppRgb555Specifies that pixel format is 16 bits per pixel. The color information specifies 65536 shades of gray.
Format16bppRgb565Specifies that pixel format is 16 bits per pixel. The color information specifies 32768 shades of color of which 5 bits are red, 5 bits are green and 5 bits are blue.
Format1bppIndexedSpecifies that pixel format is 1 bit per pixel indexed color. The color table therefore has two colors in it.
Format24bppRgbSpecifies that pixel format is 24 bits per pixel. The color information specifies 16777216 shades of color of which 8 bits are red, 8 bits are green and 8 bits are blue.
Format32bppArgbSpecifies that pixel format is 32 bits per pixel. The color information specifies 16777216 shades of color of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are alpha bits.
Format32bppPArgbSpecifies that pixel format is 32 bits per pixel. The color information specifies 16777216 shades of color of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are pre-multiplied alpha bits.
Format32bppRgbSpecifies that pixel format is 24 bits per pixel. The color information specifies 16777216 shades of color of which 8 bits are red, 8 bits are green and 8 bits are blue.
Format48bppRgbSpecifies that pixel format is 48 bits per pixel. The color information specifies 16777216 shades of color of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are alpha bits.
Format4bppIndexedSpecifies that pixel format is 4 bits per pixel indexed color. The color table therefore has 16 colors in it.
Format64bppArgbSpecifies pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are alpha bits.
Format64bppPArgbSpecifies that pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are pre-multiplied alpha bits.
Format8bppIndexedSpecifies that pixel format is 8 bits per pixel indexed color. The color table therefore has 256 colors in it.
GdiSpecifies that pixel data contains GDI colors.
IndexedSpecifies that pixel data contains color indexed values which means they are an index to colors in the system color table, as opposed to individual color values.
MaxSpecifies that pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are alpha bits.
PAlphaSpecifies that pixel format contains pre-multiplied alpha values.
UndefinedSpecifies that pixel format is undefined.

Used By

NameDescription
Bitmap.CloneCreates a copy of the section of this Bitmap defined by with a specified PixelFormat.
Bitmap.LockBitsLocks a portion of the bitmap for direct pixel manipulation.
Image.PixelFormatGets the pixel format for this Image.
Image.GetPixelFormatSizeReturns the color depth, in number of bits per pixel, of the specified pixel format.
Image.IsAlphaPixelFormatReturns a value that indicates whether the pixel format for this Image contains alpha information.
Image.IsExtendedPixelFormatReturns a value that indicates whether the pixel format is 64 bits per pixel.
Image.IsCanonicalPixelFormatReturns a value that indicates whether the pixel format is 32 bits per pixel.
BitmapData.PixelFormatGets or sets the format of the pixel information in this Bitmap.