Paints an area with an image.
public ref class ImageBrush sealed : System::Windows::Media::TileBrush
public sealed class ImageBrush : System.Windows.Media.TileBrush
type ImageBrush = class inherit TileBrush
Public NotInheritable Class ImageBrush Inherits TileBrush
An ImageBrush is a type of TileBrush that defines its content as an image, which is specified by its ImageSource property. You can control how the image is stretched, aligned, and tiled, enabling you to produce patterns and other effects. The following images show some effects that can be achieved with an ImageBrush.
An ImageBrush can paint shapes, controls, text, and more
As mentioned, an ImageBrush paints an area with an ImageSource. The most common type of ImageSource to use with an ImageBrush is a BitmapImage, which describes a bitmap graphic. You can use a DrawingImage to paint using a Drawing object, but it is simpler to use a DrawingBrush instead. For more information about ImageSource objects, see Imaging Overview.
Because the ImageBrush class inherits from Freezable, ImageBrush objects gain several special features, which include the following: they can be declared as , shared among multiple objects, made read-only to improve performance, cloned, and made thread safe. For more information about the features provided by Freezable objects, see Freezable Objects Overview.
|ImageBrush() ImageBrush() ImageBrush() ImageBrush()||
Initializes a new instance of the ImageBrush class with no content.
|ImageBrush(ImageSource) ImageBrush(ImageSource) ImageBrush(ImageSource) ImageBrush(ImageSource)||
Initializes a new instance of the ImageBrush class that paints an area with the specified image.
|ImageSourceProperty ImageSourceProperty ImageSourceProperty ImageSourceProperty||
Identifies the ImageSource dependency property.
|AlignmentX AlignmentX AlignmentX AlignmentX||
Gets or sets the horizontal alignment of content in the TileBrush base tile.(Inherited from TileBrush)
|AlignmentY AlignmentY AlignmentY AlignmentY||
Gets or sets the vertical alignment of content in the TileBrush base tile.(Inherited from TileBrush)
|CanFreeze CanFreeze CanFreeze CanFreeze||
Gets a value that indicates whether the object can be made unmodifiable.(Inherited from Freezable)
|DependencyObjectType DependencyObjectType DependencyObjectType DependencyObjectType||
Gets the DependencyObjectType that wraps the CLR type of this instance.(Inherited from DependencyObject)
|Dispatcher Dispatcher Dispatcher Dispatcher||DispatcherObject)|
|HasAnimatedProperties HasAnimatedProperties HasAnimatedProperties HasAnimatedProperties||
Gets a value that indicates whether one or more AnimationClock objects is associated with any of this object's dependency properties.(Inherited from Animatable)
|ImageSource ImageSource ImageSource ImageSource||
Gets or sets the image displayed by this ImageBrush.
|IsFrozen IsFrozen IsFrozen IsFrozen||
Gets a value that indicates whether the object is currently modifiable.(Inherited from Freezable)
|IsSealed IsSealed IsSealed IsSealed||
Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited from DependencyObject)
|Opacity Opacity Opacity Opacity||
Gets or sets the degree of opacity of a Brush.(Inherited from Brush)
|RelativeTransform RelativeTransform RelativeTransform RelativeTransform||
Gets or sets the transformation that is applied to the brush using relative coordinates.(Inherited from Brush)
|Stretch Stretch Stretch Stretch||
Gets or sets a value that specifies how the content of this TileBrush stretches to fit its tiles.(Inherited from TileBrush)
|TileMode TileMode TileMode TileMode||
Gets or sets a value that specifies how a TileBrush fills the area that you are painting if the base tile is smaller than the output area.(Inherited from TileBrush)
|Transform Transform Transform Transform||
Gets or sets the transformation that is applied to the brush. This transformation is applied after the brush's output has been mapped and positioned.(Inherited from Brush)
|Viewbox Viewbox Viewbox Viewbox||
Gets or sets the position and dimensions of the content in a TileBrush tile.(Inherited from TileBrush)
|ViewboxUnits ViewboxUnits ViewboxUnits ViewboxUnits||TileBrush)|
|Viewport Viewport Viewport Viewport||
Gets or sets the position and dimensions of the base tile for a TileBrush.(Inherited from TileBrush)
|ViewportUnits ViewportUnits ViewportUnits ViewportUnits||
Gets or sets a BrushMappingMode enumeration that specifies whether the value of the Viewport, which indicates the size and position of the TileBrush base tile, is relative to the size of the output area.(Inherited from TileBrush)
|Changed Changed Changed Changed||
Occurs when the Freezable or an object it contains is modified.(Inherited from Freezable)
Explicit Interface Implementations
|IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider)||
Formats the value of the current instance using the specified format.(Inherited from Brush)
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.