
For example, placing dotnet_bot.png in the root folder of a project named MyProject will result in a resource ID of MyProject.dotnet_bot.png. Load an embedded imageĮmbedded images can be added to an assembly as a resource by dragging them into your project, and ensuring their build action is set to Embedded resource in the Properties window.Įmbedded images are loaded based on their resource ID, which is compromised of the name of the project and its location in the project. In this example, the caching period is set to 10 days.
Godocs maui code#
The equivalent C# code is: Image image = new Image() To set a specific cache period, set the Source property to an UriImageSource object that sets its CacheValidity property: The default value of this property is true.
Godocs maui android#
To comply with Android resource naming rules, all local image filenames must be lowercase, start and end with a letter character, and contain only alphanumeric characters or underscores. This is necessary because different platforms support different image resolutions, and the operating system chooses the appropriate image resolution at runtime based on the device's capabilities. At build time, vector images are resized to the correct resolutions for the target platform and device, and added to your app package. Images can be added to your app project by dragging them to the Resources\Images folder of your project, where its build action will automatically be set to MauiImage.
Godocs maui full#
Images will be displayed at their full resolution unless the size of the Image is constrained by its layout, or the HeightRequest or WidthRequest property of the Image is specified.įor information about adding app icons and a splash screen to your app, see App icons and Splash screen. These properties are backed by BindableProperty objects, which means that they can be styled, and be the target of data bindings. Source, of type ImageSource, specifies the source of the image.The default value of this property is false. IsOpaque, of type bool, indicates whether the rendering engine may treat the image as opaque while rendering it.

IsLoading, of type bool, indicates the loading status of the image.IsAnimationPlaying, of type bool, determines whether an animated GIF is playing or stopped.Aspect, of type Aspect, defines the scaling mode of the image.NET MAUI app project, see Add images to a. For more information about adding images to a. The standard platform image formats are supported, including animated GIFs, and local Scalable Vector Graphics (SVG) files are also supported. NET Multi-platform App UI (.NET MAUI) Image displays an image that can be loaded from a local file, a URI, an embedded resource, or a stream.
