BitmapDataFactoryCreateSolid(Size, Color32) Method

Creates a read-only bitmap data with no actual underlying buffer that has the specified size and solid color.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.1
C#
public static IReadableBitmapData CreateSolid(
	Size size,
	Color32 color
)

Parameters

size  Size
The size of the bitmap data to create, in pixels.
color  Color32
The color of the entire bitmap.

Return Value

IReadableBitmapData
An IReadableBitmapData instance representing a bitmap of the specified size that returns the specified color for each pixel.

Remarks

The returned bitmap data has no allocated underlying buffer, and simply returns the specified color for each pixel.

  Note

Operations on the result that return a new bitmap data (e.g. Clone, Resize, ToGrayscale, etc.) allocate a new buffer though.

Exceptions

ArgumentOutOfRangeExceptionsize has a zero or negative width or height.

See Also