Skip to content

PlatformBitmapLoader class

Defined in

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

Summary

View source

        Provides platform-specific functionality for loading bitmap images from streams or drawable resources, with support
        for AOT-friendly resource registration in MAUI applications.
        

Applies to

net10.0-android36.0, net10.0-ios26.0, net10.0-macos26.0, net10.0-windows10.0.17763, net10.0-windows10.0.19041, net10.0-maccatalyst26.0, net10.0-tvos26.0, net9.0-windows10.0.17763, net9.0-windows10.0.19041, net8.0-windows10.0.19041, net8.0-windows10.0.17763, net462, net481

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

Implements: IBitmapLoader, IEnableLogger

Remarks

To ensure compatibility with ahead-of-time (AOT) compilation, register a drawable resolver function using RegisterDrawableResolver or a Resource.Drawable type using RegisterDrawables before creating instances of this class. If neither is registered, the loader will fall back to reflection-based assembly scanning, which is not AOT-compatible. For full AOT compatibility, consider using PlatformBitmapLoader instead.

Constructors

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

Methods

NameSummary
static RegisterDrawableResolverRegisters a drawable resolver function for AOT-friendly resource lookup. This avoids assembly scanning and is recommended for modern MAUI applications.
static RegisterDrawablesRegisters a Resource.Drawable type for AOT-friendly resource lookup. This avoids assembly scanning and is recommended for modern MAUI applications.
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