Skip to content

PlatformBitmapLoader class

Defined in

Namespace: Splat Assembly: Splat.Drawing.dll Full name: Splat.PlatformBitmapLoader<T> Modifiers: public

Summary

View source

        AOT-compatible platform bitmap loader for Android.
        This version requires explicit drawable name-to-ID mapping and uses no reflection.
        

Applies to

net10.0-android36.0

Class hierarchy
classDiagram
class PlatformBitmapLoader~T~
class IBitmapLoader {
    <>
}
IBitmapLoader <|.. PlatformBitmapLoader~T~
class IEnableLogger {
    <>
}
IEnableLogger <|.. PlatformBitmapLoader~T~

Implements: IBitmapLoader, IEnableLogger

Examples

// In your MAUI application startup:
 var loader = new PlatformBitmapLoader<MyApp.Resource.Drawable>(name => name switch
 {
 "icon" => Resource.Drawable.icon,
 "logo" => Resource.Drawable.logo,
 "splash" => Resource.Drawable.splash,
 _ => 0
 });
 Locator.CurrentMutable.RegisterConstant<IBitmapLoader>(loader);

Constructors

NameSummary
.ctorInitializes a new instance of the [PlatformBitmapLoader](# class.

Properties

NameSummary
DrawableTypeGets the Resource.Drawable type this loader was associated with at compile time.

Methods

NameSummary
LoadLoads a bitmap from a byte stream.
LoadFromResourceLoads from the application's resources (i.e. from bundle on Cocoa, from Pack URIs on Windows, etc).
CreateCreates an empty bitmap of the specified dimensions.
Inherited members