This code sets the Aspect property, which defines the scaling mode of the image, to Fill. In MainPage.xaml, modify the Image declaration to customize its appearance: Then, in MainPage.xaml, remove all of the template code and replace it with the following code: In Solution Pad, in the ImageTutorial project, double-click MainPage.xaml to open it. The HeightRequest property specifies the height of the Image in device-independent units. For more information, see Displaying images in the Images in Xamarin.Forms guide. The Image.Source property is of type ImageSource, which enables images to be sourced from files, URIs, or resources. The Image.Source property specifies the image to display, via a URI. This code declaratively defines the user interface for the page, which consists of an Image in a StackLayout. In Solution Explorer, in the ImageTutorial project, double-click MainPage.xaml to open it. NET Standard library that gets created, see Anatomy of a Xamarin.Forms application in the Xamarin.Forms Quickstart Deep Dive. Using a different name will result in build errors when you copy code from this tutorial into the solution.įor more information about the. The C# and XAML snippets in this tutorial requires that the solution is named ImageTutorial.