Xamarin.Forms Guides | Samples

Xamarin.Forms.Image Class

View that holds an image.

See Also: Image


public class Image : View, IElementConfiguration<Image>, IImageController


The following example creates a new image from a file

C# Example

var image = new Image { Source = "picture.png" };

The FormsGallery sample, which can be found on the Sample Applications page, has a ImageDemoPage.cs file. This file contains a longer and more complicated example.


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,

The members of Xamarin.Forms.Image are listed below.

See Also: View

Public Constructors

Initializes a new instance of the Image class.

Public Fields

static readonly
AspectPropertyBindableProperty. Identifies the Aspect bindable property.
static readonly
IsLoadingPropertyBindableProperty. Identifies the IsLoading bindable property.
static readonly
IsOpaquePropertyBindableProperty. Backing store for the IsOpaque bindable property.
static readonly
SourcePropertyBindableProperty. Identifies the Source bindable property.

Public Properties

AspectAspect. Gets or sets the scaling mode for the image. This is a bindable property.
IsLoadingBoolean. Gets the loading status of the image. This is a bindable property.
IsOpaqueBoolean. Gets or sets a Boolean value that, if true hints to the rendering engine that it may safely omit drawing visual elements behind the image.
SourceImageSource. Gets or sets the source of the image. This is a bindable property.

Public Methods

On<T>() : IPlatformElementConfiguration<T, Image>
Returns the platform-specific instance of this Image, on which a platform-specific method may be called.
Sets a value that indicates whether the image is currently loading.

Protected Methods

Invoked when the BindingContext changes.
Invoked when a property has changed.
Invoked when a property will change.
OnSizeRequest(Double, Double) : SizeRequest
Invoked when the layotu cycle request the element desired size.