BrushCreateTexture(IReadableBitmapData, TextureMapMode, Point, Boolean) Method

Creates a texture Brush with the specified texture.
See the Examples section of the TextureMapMode enumeration for image examples.

Definition

Namespace: KGySoft.Drawing.Shapes
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
C#
public static Brush CreateTexture(
	IReadableBitmapData texture,
	TextureMapMode mapMode = TextureMapMode.Tile,
	Point offset = default,
	bool hasAlphaHint = true
)

Parameters

texture  IReadableBitmapData
The texture to use for the Brush.
mapMode  TextureMapMode  (Optional)
Determines how the texture is mapped to the target area. This parameter is optional.
Default value: Tile.
offset  Point  (Optional)
Specifies an offset to apply when mapping the texture to the target area. This parameter is optional.
Default value: Point.Empty.
hasAlphaHint  Boolean  (Optional)
to indicate that the texture uses the alpha channel (has transparency); otherwise, . This parameter is optional.
Default value: .

Return Value

Brush
A Brush that uses the specified texture.

Remarks

This overload maps the entire texture to the target IReadWriteBitmapData. To use only a smaller region of it, use the CreateTexture(IReadableBitmapData, Rectangle, TextureMapMode, Point, Boolean) overload instead.

If the pixel format of the texture has alpha channel, but the texture does not use it, you can set the hasAlphaHint parameter to to improve performance. If the pixel format of the texture does not have an alpha channel, then this parameter is ignored.

See Also