Share via


ImageSource.FromResource Method

Definition

Overloads

Name Description
FromResource(String, Assembly)

Creates an ImageSource from an embedded resource in the specified assembly.

FromResource(String, Type)

Creates an ImageSource from an embedded resource in the assembly containing the specified type.

FromResource(String, Assembly)

Source:
ImageSource.cs
Source:
ImageSource.cs
Source:
ImageSource.cs

Creates an ImageSource from an embedded resource in the specified assembly.

public static Microsoft.Maui.Controls.ImageSource FromResource(string resource, System.Reflection.Assembly sourceAssembly = default);
static member FromResource : string * System.Reflection.Assembly -> Microsoft.Maui.Controls.ImageSource
Public Shared Function FromResource (resource As String, Optional sourceAssembly As Assembly = Nothing) As ImageSource

Parameters

resource
String

The name of the embedded resource.

sourceAssembly
Assembly

The assembly containing the resource, or null to use the calling assembly.

Returns

A StreamImageSource for the embedded resource.

Applies to

FromResource(String, Type)

Source:
ImageSource.cs
Source:
ImageSource.cs
Source:
ImageSource.cs

Creates an ImageSource from an embedded resource in the assembly containing the specified type.

public:
 static Microsoft::Maui::Controls::ImageSource ^ FromResource(System::String ^ resource, Type ^ resolvingType);
public static Microsoft.Maui.Controls.ImageSource FromResource(string resource, Type resolvingType);
static member FromResource : string * Type -> Microsoft.Maui.Controls.ImageSource
Public Shared Function FromResource (resource As String, resolvingType As Type) As ImageSource

Parameters

resource
String

The name of the embedded resource.

resolvingType
Type

A type whose assembly contains the resource.

Returns

A StreamImageSource for the embedded resource.

Applies to