BitmapDataFactoryCreateSolid(Int32, Int32, 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(
	int width,
	int height,
	Color32 color
)

Parameters

width  Int32
The width of the bitmap data to create, in pixels.
height  Int32
The height 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

ArgumentOutOfRangeExceptionwidth or height is zero or negative.

See Also