TextureMapMode Enumeration

Represents the possible modes how a texture is mapped when filling a shape by a texture Brush.

See the online help for image examples.

Definition

Namespace: KGySoft.Drawing.Shapes
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
C#
public enum TextureMapMode

Examples

The following table demonstrates the possible TextureMapMode values and their effect:

DescriptionImage Example
Tile: The texture is tiled using the same orientation. DrawingOptions.AlphaBlending is , so the transparent pixels of the texture don't affect the background.Texture brush with Tile map mode. AntiAliasing = true, AlphaBlending = true.
TileFlipX: The texture is tiled, mirroring the adjacent tiles horizontally in each row. DrawingOptions.AlphaBlending is , so the transparent pixels of the texture don't affect the background.Texture brush with TileFlipX map mode. AntiAliasing = true, AlphaBlending = true.
TileFlipY: The texture is tiled, mirroring the adjacent tiles vertically in each column. DrawingOptions.AlphaBlending is , so the transparent pixels of the texture don't affect the background.Texture brush with TileFlipY map mode. AntiAliasing = true, AlphaBlending = true.
TileFlipXY: The texture is tiled, mirroring the adjacent tiles horizontally in each row and vertically in each column. DrawingOptions.AlphaBlending is , so the transparent pixels of the texture don't affect the background.Texture brush with TileFlipXY map mode. AntiAliasing = true, AlphaBlending = true.
Clip: The texture is clipped to the shape without tiling. As in this example the texture does not cover the entire shape, the exceeding regions are simply handled as if they were transparent. As no offset is specified, the texture's location is the top-left corner of the target IReadWriteBitmapData, so it can be seen only in the topmost ellipse. DrawingOptions.AlphaBlending is , so the transparent ellipses indicate the regions of the fill operations.Texture brush with Clip map mode. AntiAliasing = false, AlphaBlending = false.
Extend: Similar to Clip, except that the exceeding regions are filled by extending the texture's edge pixels. In this example the texture does not have homogeneous colors at the edges, hence the stripes in the exceeding regions. DrawingOptions.AlphaBlending is , so the transparent ellipses indicate the regions of the fill operations.Texture brush with Extend map mode. AntiAliasing = false, AlphaBlending = false.
Center: Same as Clip, but the texture is always centered in the currently filled shape. DrawingOptions.AlphaBlending is , so the transparent ellipses indicate the regions of the fill operations.Texture brush with Center map mode. AntiAliasing = false, AlphaBlending = false.
CenterExtend: Similar to Extend, but the texture is always centered in the currently filled shape. In this example the left edge of the texture completely transparent, so we don't see pixels extended to the left. DrawingOptions.AlphaBlending is , so the transparent ellipses indicate the regions of the fill operations.Texture brush with CenterExtend map mode. AntiAliasing = false, AlphaBlending = false.
Stretch: The texture is stretched to fill the entire shape. The texture's aspect ratio is not preserved. DrawingOptions.AlphaBlending is , so the small transparent regions didn't affect the background. DrawingOptions.AntiAliasing is also , so the stretching was performed with using an interpolation.Texture brush with Stretch map mode. AntiAliasing = true, AlphaBlending = true.
Zoom: Similar to Stretch, but the texture's aspect ratio is preserved. DrawingOptions.AlphaBlending is , so the transparent ellipses indicate the regions of the fill operations. DrawingOptions.AntiAliasing is , so the zooming was performed with the nearest neighbor algorithm.Texture brush with Zoom map mode. AntiAliasing = false, AlphaBlending = false.

Members

Tile0 The texture is tiled, using the same orientation for each tile.

See the online help for image examples.
TileFlipX1 The texture is tiled, mirroring the adjacent tiles horizontally in each row.

See the online help for image examples.
TileFlipY2 The texture is tiled, mirroring the adjacent tiles vertically in each column.

See the online help for image examples.
TileFlipXY3 The texture is tiled, mirroring the adjacent tiles horizontally in each row and vertically in each column.

See the online help for image examples.
Clip4 The texture is clipped to the shape without tiling. If the texture does not cover the entire shape, the exceeding regions are simply handled as if they were transparent. If no offset is specified, the texture's location is the top-left corner of the target IReadWriteBitmapData, regardless of the shape's location.

See the online help for image examples.
Extend5 The texture is clipped to the shape without tiling. If the texture does not cover the entire shape, the exceeding regions are filled by extending the texture's edge pixels. If no offset is specified, the texture's location is the top-left corner of the target IReadWriteBitmapData, regardless of the shape's location.

See the online help for image examples.
Center6 Similar to Clip, but the texture is always centered in the currently filled shape. If there is an offset specified, it is applied relative to the center of the shape.

See the online help for image examples.
CenterExtend7 Similar to Extend, but the texture is always centered in the currently filled shape. If there is an offset specified, it is applied relative to the center of the shape.

See the online help for image examples.
Stretch8 The texture is stretched to fill the entire shape. The texture's aspect ratio is not preserved. if DrawingOptions.AntiAliasing is , then the texture is resized with an automatically selected interpolation; otherwise, the texture is resized using the nearest neighbor algorithm. The used color space for resizing depends on the WorkingColorSpace of the original texture. Please note that this generates a new texture for each shape, so it can be slow for large shapes.

See the online help for image examples.
Zoom9 Similar to Stretch, but the texture's aspect ratio is preserved. If the texture does not cover the entire shape, the exceeding regions are simply handled as if they were transparent.

See the online help for image examples.

See Also