Class Image
Represents a control that displays an image. The image is specified as an image file in several possible formats, see Remarks.
Inheritance
System.Object
Image
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: OpenSilver.dll
Syntax
public sealed class Image : FrameworkElement, IFrameworkElement, IUIElement, IDependencyObject
Examples
Image image = new Image();
image.Source = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri("ms-appx:/MyImage.png"));
MyStackPanel.Children.Add(image);
Fields
|
Improve this Doc
View Source
SourceProperty
Identifies the Source dependency property.
Declaration
public static readonly DependencyProperty SourceProperty
Field Value
|
Improve this Doc
View Source
StretchProperty
Identifies the Stretch dependency property.
Declaration
public static readonly DependencyProperty StretchProperty
Field Value
Properties
|
Improve this Doc
View Source
Source
Gets or sets the source for the image.
Declaration
public ImageSource Source { get; set; }
Property Value
Type |
Description |
ImageSource |
A source object for the drawn image.
|
|
Improve this Doc
View Source
Stretch
Gets or sets a value that describes how an Image should
be stretched to fill the destination rectangle.
Declaration
public Stretch Stretch { get; set; }
Property Value
Type |
Description |
Stretch |
A value of the Stretch enumeration that specifies how the
source image is applied if the Height and
Width of the Image are specified
and are different than the source image's height and width. The default value
is Uniform.
|
Methods
|
Improve this Doc
View Source
ArrangeOverride(Size)
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type |
Name |
Description |
Size |
finalSize |
|
Returns
Overrides
|
Improve this Doc
View Source
CreateDomElement(Object, out Object)
Declaration
public override object CreateDomElement(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
Type |
Name |
Description |
System.Object |
parentRef |
|
System.Object |
domElementWhereToPlaceChildren |
|
Returns
Type |
Description |
System.Object |
|
Overrides
|
Improve this Doc
View Source
MeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type |
Name |
Description |
Size |
availableSize |
|
Returns
Overrides
|
Improve this Doc
View Source
OnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Overrides
Events
|
Improve this Doc
View Source
ImageFailed
Occurs when there is an error associated with image retrieval or format.
Declaration
public event EventHandler<ExceptionRoutedEventArgs> ImageFailed
Event Type
|
Improve this Doc
View Source
ImageOpened
Occurs when the image source is downloaded and decoded with no failure.
Declaration
public event EventHandler<RoutedEventArgs> ImageOpened
Event Type
Extension Methods