Click or drag to resize
CanvasImageBrush Class
A brush which paints using image content, such as a bitmap. Useful for producing tiled backgrounds, or filling geometry with a pattern.
Inheritance Hierarchy
SystemObject
  Microsoft.Graphics.Canvas.BrushesCanvasImageBrush

Namespace:  Microsoft.Graphics.Canvas.Brushes
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public sealed class CanvasImageBrush : ICanvasBrush, 
	IDisposable

The CanvasImageBrush type exposes the following members.

Constructors
  NameDescription
Public methodCanvasImageBrush(ICanvasResourceCreator)
Initializes a new instance of the CanvasImageBrush class.
Public methodCanvasImageBrush(ICanvasResourceCreator, ICanvasImage)
Initializes a new instance of the CanvasImageBrush class.
Top
Properties
  NameDescription
Public propertyDevice
The device associated with this brush.
Public propertyExtendX
Specifies how content is tiled horizontally when it extends beyond the Image.
Public propertyExtendY
Specifies how content is tiled vertically when it extends beyond the Image.
Public propertyImage
Specifies an image used for the brush.
Public propertyInterpolation
Specifies the image quality used for resizing and transforms.
Public propertyOpacity
Specifies an opacity level used for this brush. The default is fully opaque.
Public propertySourceRectangle
Optional field which specifies the source rectangle of the brush.
Public propertyTransform
Specifies a transform used for this brush. The default transform is identity.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by the CanvasImageBrush.
Top
Remarks

When using Direct2D interop, this Win2D class corresponds to the Direct2D interface ID2D1BitmapBrush1 (if Image is a CanvasBitmap and SourceRectangle is null) or ID2D1ImageBrush (if Image is any other type of ICanvasImage, or if SourceRectangle is set).

See Also