Class ImageBrush<TPixel>
- Namespace
- SixLabors.ImageSharp.Drawing.Processing
- Assembly
- SixLabors.ImageSharp.Drawing.dll
Provides an implementation of an image brush for painting images within areas.
public sealed class ImageBrush<TPixel> : ImageBrush, IEquatable<Brush> where TPixel : unmanaged, IPixel<TPixel>
Type Parameters
TPixelThe pixel format of the source image.
- Inheritance
-
ImageBrush<TPixel>
- Implements
- Inherited Members
Constructors
ImageBrush(Image<TPixel>)
Initializes a new instance of the ImageBrush<TPixel> class.
public ImageBrush(Image<TPixel> image)
Parameters
imageImage<TPixel>The source image to draw.
ImageBrush(Image<TPixel>, WrapMode, WrapMode)
Initializes a new instance of the ImageBrush<TPixel> class.
public ImageBrush(Image<TPixel> image, WrapMode wrapX, WrapMode wrapY)
Parameters
imageImage<TPixel>The source image to draw.
wrapXWrapModeThe wrap mode used when sampling horizontally beyond the source region.
wrapYWrapModeThe wrap mode used when sampling vertically beyond the source region.
ImageBrush(Image<TPixel>, Point)
Initializes a new instance of the ImageBrush<TPixel> class.
public ImageBrush(Image<TPixel> image, Point offset)
Parameters
imageImage<TPixel>The source image to draw.
offsetPointAn offset to apply to the image while drawing the texture.
ImageBrush(Image<TPixel>, Point, WrapMode, WrapMode)
Initializes a new instance of the ImageBrush<TPixel> class.
public ImageBrush(Image<TPixel> image, Point offset, WrapMode wrapX, WrapMode wrapY)
Parameters
imageImage<TPixel>The source image to draw.
offsetPointAn offset to apply to the image while drawing the texture.
wrapXWrapModeThe wrap mode used when sampling horizontally beyond the source region.
wrapYWrapModeThe wrap mode used when sampling vertically beyond the source region.
ImageBrush(Image<TPixel>, RectangleF)
Initializes a new instance of the ImageBrush<TPixel> class.
public ImageBrush(Image<TPixel> image, RectangleF region)
Parameters
imageImage<TPixel>The source image to draw.
regionRectangleFThe region of interest within the source image.
ImageBrush(Image<TPixel>, RectangleF, WrapMode, WrapMode)
Initializes a new instance of the ImageBrush<TPixel> class.
public ImageBrush(Image<TPixel> image, RectangleF region, WrapMode wrapX, WrapMode wrapY)
Parameters
imageImage<TPixel>The source image to draw.
regionRectangleFThe region of interest within the source image.
wrapXWrapModeThe wrap mode used when sampling horizontally beyond the source region.
wrapYWrapModeThe wrap mode used when sampling vertically beyond the source region.
ImageBrush(Image<TPixel>, RectangleF, Point)
Initializes a new instance of the ImageBrush<TPixel> class.
public ImageBrush(Image<TPixel> image, RectangleF region, Point offset)
Parameters
imageImage<TPixel>The source image to draw.
regionRectangleFThe region of interest within the source image.
offsetPointAn offset to apply to the image while drawing the texture.
ImageBrush(Image<TPixel>, RectangleF, Point, WrapMode, WrapMode)
Initializes a new instance of the ImageBrush<TPixel> class.
public ImageBrush(Image<TPixel> image, RectangleF region, Point offset, WrapMode wrapX, WrapMode wrapY)
Parameters
imageImage<TPixel>The source image to draw.
regionRectangleFThe region of interest within the source image.
offsetPointAn offset to apply to the image while drawing the texture.
wrapXWrapModeThe wrap mode used when sampling horizontally beyond the source region.
wrapYWrapModeThe wrap mode used when sampling vertically beyond the source region.
Properties
SourceImage
Gets the typed source image used by this brush.
public Image<TPixel> SourceImage { get; }
Property Value
- Image<TPixel>
Methods
Transform(Matrix4x4, Rectangle, Rectangle)
Returns a new brush with its defining geometry transformed by the given matrix.
public override Brush Transform(Matrix4x4 matrix, Rectangle sourceInterest, Rectangle preparedInterest)
Parameters
matrixMatrix4x4The transformation matrix to apply.
sourceInterestRectangleThe command interest before preparation.
preparedInterestRectangleThe command interest after preparation.
Returns
- Brush
A transformed brush, or
thisif the brush has no spatial parameters.