Class Image
Displays a Bitmap image.
public class Image : Control, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
- Inheritance
-
Image
- Implements
- Inherited Members
- Extension Methods
Constructors
Image()
public Image()
Fields
BlendModeProperty
Defines the BlendMode property.
public static readonly StyledProperty<BitmapBlendingMode> BlendModeProperty
Field Value
SourceProperty
Defines the Source property.
public static readonly StyledProperty<IImage?> SourceProperty
Field Value
StretchDirectionProperty
Defines the StretchDirection property.
public static readonly StyledProperty<StretchDirection> StretchDirectionProperty
Field Value
StretchProperty
Defines the Stretch property.
public static readonly StyledProperty<Stretch> StretchProperty
Field Value
Properties
BlendMode
Gets or sets the blend mode for the image.
public BitmapBlendingMode BlendMode { get; set; }
Property Value
BypassFlowDirectionPolicies
Gets a value indicating whether control bypass FlowDirecton policies.
protected override bool BypassFlowDirectionPolicies { get; }
Property Value
Remarks
Related to FlowDirection system and returns false as default, so if FlowDirection is RTL then control will get a mirror presentation. For controls that want to avoid this behavior, override this property and return true.
Source
Gets or sets the image that will be displayed.
[Content]
public IImage? Source { get; set; }
Property Value
Stretch
Gets or sets a value controlling how the image will be stretched.
public Stretch Stretch { get; set; }
Property Value
StretchDirection
Gets or sets a value controlling in what direction the image will be stretched.
public StretchDirection StretchDirection { get; set; }
Property Value
Methods
ArrangeOverride(Size)
Positions child elements as part of a layout pass.
protected override Size ArrangeOverride(Size finalSize)
Parameters
finalSize
SizeThe size available to the control.
Returns
- Size
The actual size used.
MeasureOverride(Size)
Measures the control.
protected override Size MeasureOverride(Size availableSize)
Parameters
availableSize
SizeThe available size.
Returns
- Size
The desired size of the control.
OnCreateAutomationPeer()
Returns a new, type-specific AutomationPeer implementation for the control.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer
The type-specific AutomationPeer implementation.
Render(DrawingContext)
Renders the control.
public override sealed void Render(DrawingContext context)
Parameters
context
DrawingContextThe drawing context.