Xamarin.Forms Guides | Samples

Xamarin.Forms.Image Class

View that holds an image.

See Also: Image

Syntax

[Xamarin.Forms.RenderWith(typeof(Xamarin.Forms.Platform._ImageRenderer))]
public class Image : View, IElementConfiguration<Image>, IImageController

Remarks

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.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

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. Identifies 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.
[read-only]
IsLoadingBoolean. Gets the loading status of the image. This is a bindable property.
IsOpaqueBoolean. Gets or sets the opacity flag for the image. This is a bindable property.
SourceImageSource. Gets or sets the source of the image. This is a bindable property.

Public Methods

Protected Methods

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

Explicitly Implemented Interface Members