BitmapDataFactoryCreateBitmapData Method

There are quite a few overloads of the CreateBitmapData method but they can be grouped into different categories:
  • The ones whose first parameter is Size, or the first couple of parameters are integers for width and height, are allocating the buffer for the created bitmap data by themselves, whereas the others use pre-allocated buffers.
  • The overloads whose first parameter name is buffer can be used to create a bitmap data for a preallocated buffer. This buffer can be a one or two-dimensional array, an ArraySection<T> or Array2D<T> value wrapping a one dimensional array that represents a section of the array as a one or two-dimensional view, or it can be an IntPtr representing a potentially unmanaged buffer.
  • If an overload has a KnownPixelFormat parameter, then it can be used to create a bitmap data using one of the pixel formats with built-in support.
  • To create a bitmap data with a custom pixel format you can pick the overloads that have a PixelFormatInfo parameter along with a couple of delegates, or the ones with a CustomBitmapDataConfig or CustomIndexedBitmapDataConfig parameter for the best customization.
  • For indexed pixel formats look for the overloads that have a Palette or a CustomIndexedBitmapDataConfig parameter.

Overload List

CreateBitmapData(Size, KnownPixelFormat, Palette) Creates an IReadWriteBitmapData instance with the specified size, pixelFormat and palette.
CreateBitmapData(Int32, Int32, KnownPixelFormat, Palette) Creates an IReadWriteBitmapData instance with the specified width, height, pixelFormat and palette.
CreateBitmapData(IntPtr, Size, Int32, CustomBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping an unmanaged buffer and using the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapData(IntPtr, Size, Int32, CustomIndexedBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping an unmanaged buffer and using the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload for details.
CreateBitmapData(Size, KnownPixelFormat, Color32, Byte) Creates an IReadWriteBitmapData instance with the specified size and pixelFormat.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapData(Int32, Int32, KnownPixelFormat, Color32, Byte) Creates an IReadWriteBitmapData instance with the specified width, height and pixelFormat.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) Creates an IReadWriteBitmapData instance with the specified size and pixelFormat.
CreateBitmapData(Int32, Int32, KnownPixelFormat, WorkingColorSpace, Color32, Byte) Creates an IReadWriteBitmapData instance with the specified width, height and pixelFormat.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapData(IntPtr, Size, Int32, KnownPixelFormat, Color32, Byte, Action) Creates an IReadWriteBitmapData instance wrapping an unmanaged buffer and using the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapData(IntPtr, Size, Int32, KnownPixelFormat, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance wrapping an unmanaged buffer and using the specified parameters.
CreateBitmapData(IntPtr, Size, Int32, KnownPixelFormat, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance wrapping an unmanaged buffer and using the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapData(IntPtr, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRow, Int32, Color32, ActionICustomBitmapDataRow, Int32, Color32, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping an unmanaged buffer and using the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapData(IntPtr, Size, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapData(IntPtr, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRow, Int32, Int32, ActionICustomBitmapDataRow, Int32, Int32, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping an unmanaged buffer and using the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Int32, ActionICustomBitmapDataRowT, Int32, Int32, Palette, FuncPalette, Boolean, Action) overload for details.
CreateBitmapData(IntPtr, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRow, Int32, Color32, ActionICustomBitmapDataRow, Int32, Color32, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping an unmanaged buffer and using the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapData(IntPtr, Size, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(Array2DT, Int32, CustomBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping the specified buffer and using the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(Array2DT, Int32, CustomIndexedBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom indexed pixel format wrapping the specified buffer and using the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload for details.
CreateBitmapDataT(T, Int32, CustomBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format for a preallocated two-dimensional array with the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(T, Int32, CustomIndexedBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom indexed pixel format for a preallocated two-dimensional array with the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload for details.
CreateBitmapDataT(ArraySectionT, Size, Int32, CustomBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping the specified buffer and using the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(ArraySectionT, Size, Int32, CustomIndexedBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom indexed pixel format wrapping the specified buffer and using the specified parameters.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload for details.
CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format for a preallocated one dimensional array with the specified parameters.
CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) Creates an IReadWriteBitmapData instance with a custom indexed pixel format for a preallocated one dimensional array with the specified parameters.
CreateBitmapDataT(T, Int32, KnownPixelFormat, Color32, Byte, Action) Creates an IReadWriteBitmapData instance for a preallocated two-dimensional array with the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapDataT(T, Int32, KnownPixelFormat, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance for a preallocated two-dimensional array with the specified parameters.
CreateBitmapDataT(Array2DT, Int32, KnownPixelFormat, Color32, Byte, Action) Creates an IReadWriteBitmapData instance wrapping the specified buffer and using the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapDataT(Array2DT, Int32, KnownPixelFormat, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance wrapping the specified buffer and using the specified parameters.
CreateBitmapDataT(T, Size, Int32, KnownPixelFormat, Color32, Byte, Action) Creates an IReadWriteBitmapData instance for a preallocated one dimensional array with the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapDataT(T, Size, Int32, KnownPixelFormat, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance for a preallocated one dimensional array with the specified parameters.
CreateBitmapDataT(T, Int32, KnownPixelFormat, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance for a preallocated two-dimensional array with the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapDataT(Array2DT, Int32, KnownPixelFormat, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance wrapping the specified buffer and using the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapDataT(ArraySectionT, Size, Int32, KnownPixelFormat, Color32, Byte, Action) Creates an IReadWriteBitmapData instance wrapping the specified buffer and using the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapDataT(ArraySectionT, Size, Int32, KnownPixelFormat, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance wrapping the specified buffer and using the specified parameters.
CreateBitmapDataT(T, Size, Int32, KnownPixelFormat, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance for a preallocated one dimensional array with the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapDataT(T, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Color32, ActionICustomBitmapDataRowT, Int32, Color32, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format for a preallocated two-dimensional array with the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(T, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(T, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Int32, ActionICustomBitmapDataRowT, Int32, Int32, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance with a custom indexed pixel format for a preallocated two-dimensional array with the specified parameters. If you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(T, Int32, CustomIndexedBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload for details.
CreateBitmapDataT(Array2DT, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Color32, ActionICustomBitmapDataRowT, Int32, Color32, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping the specified buffer and using the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(Array2DT, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(Array2DT, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Int32, ActionICustomBitmapDataRowT, Int32, Int32, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance with a custom indexed pixel format wrapping the specified buffer and using the specified parameters. If you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(Array2DT, Int32, CustomIndexedBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload for details.
CreateBitmapDataT(ArraySectionT, Size, Int32, KnownPixelFormat, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance wrapping the specified buffer and using the specified parameters.
See the Remarks section of the CreateBitmapData(Size, KnownPixelFormat, WorkingColorSpace, Color32, Byte) overload for details.
CreateBitmapDataT(T, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Color32, ActionICustomBitmapDataRowT, Int32, Color32, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format for a preallocated one dimensional array with the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(T, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Int32, ActionICustomBitmapDataRowT, Int32, Int32, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance with a custom indexed pixel format for a preallocated one dimensional array with the specified parameters. If you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload for details.
CreateBitmapDataT(T, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Color32, ActionICustomBitmapDataRowT, Int32, Color32, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format for a preallocated two-dimensional array with the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(T, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(Array2DT, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Color32, ActionICustomBitmapDataRowT, Int32, Color32, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping the specified buffer and using the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(Array2DT, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(ArraySectionT, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Color32, ActionICustomBitmapDataRowT, Int32, Color32, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping the specified buffer and using the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(ArraySectionT, Size, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(ArraySectionT, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Int32, ActionICustomBitmapDataRowT, Int32, Int32, Palette, FuncPalette, Boolean, Action) Creates an IReadWriteBitmapData instance with a custom indexed pixel format wrapping the specified buffer and using the specified parameters. If you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(ArraySectionT, Size, Int32, CustomIndexedBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomIndexedBitmapDataConfig) overload for details.
CreateBitmapDataT(T, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Color32, ActionICustomBitmapDataRowT, Int32, Color32, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format for a preallocated one dimensional array with the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.
CreateBitmapDataT(ArraySectionT, Size, Int32, PixelFormatInfo, FuncICustomBitmapDataRowT, Int32, Color32, ActionICustomBitmapDataRowT, Int32, Color32, WorkingColorSpace, Color32, Byte, Action) Creates an IReadWriteBitmapData instance with a custom non-indexed pixel format wrapping the specified buffer and using the specified parameters. By this overload you can specify a pair of custom getter/setter delegates using the Color32 color type. If other color types fit better for the custom format or you can ensure that the delegates don't capture buffer use the CreateBitmapDataT(ArraySectionT, Size, Int32, CustomBitmapDataConfig) overload instead.
See the Remarks section of the CreateBitmapDataT(T, Size, Int32, CustomBitmapDataConfig) overload for details.

See Also