TextureMapMode Enumeration
Represents the possible modes how a texture is mapped when filling a shape by a texture
Brush.
Namespace: KGySoft.Drawing.ShapesAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
public enum TextureMapMode
Public Enumeration TextureMapMode
public enum class TextureMapMode
The following table demonstrates the possible TextureMapMode values and their effect:
Description | Image 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. |  |
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. |  |
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. |  |
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. |  |
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. |  |
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. |  |
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. |  |
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. |  |
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. |  |
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. |  |
Tile | 0 |
The texture is tiled, using the same orientation for each tile.
|
TileFlipX | 1 |
The texture is tiled, mirroring the adjacent tiles horizontally in each row.
|
TileFlipY | 2 |
The texture is tiled, mirroring the adjacent tiles vertically in each column.
|
TileFlipXY | 3 |
The texture is tiled, mirroring the adjacent tiles horizontally in each row and vertically in each column.
|
Clip | 4 |
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.
|
Extend | 5 |
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.
|
Center | 6 |
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.
|
CenterExtend | 7 |
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.
|
Stretch | 8 |
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.
|
Zoom | 9 |
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.
|