Interface IBitmapLoader
- Namespace
- Splat
- Assembly
- Splat.Drawing.dll
Defines methods for loading and creating bitmap images from various sources. Unless you are testing image loading, you don't usually need to implement this.
public interface IBitmapLoader
- Extension Methods
Remarks
Implementations of this interface provide functionality to load bitmap images from streams, application resources, or to create new empty bitmaps. The specific image formats supported and resource resolution behavior may vary depending on the platform and implementation.
Methods
Create(float, float)
Creates an empty bitmap of the specified dimensions.
IBitmap? Create(float width, float height)
Parameters
Returns
- IBitmap
A new image. Use ToNative() to convert this to a native bitmap.
Load(Stream, float?, float?)
Loads a bitmap from a byte stream.
Task<IBitmap?> Load(Stream sourceStream, float? desiredWidth, float? desiredHeight)
Parameters
sourceStreamStreamThe stream to load the image from.
desiredWidthfloat?The desired width of the image.
desiredHeightfloat?The desired height of the image.
Returns
LoadFromResource(string, float?, float?)
Loads from the application's resources (i.e. from bundle on Cocoa, from Pack URIs on Windows, etc).
Task<IBitmap?> LoadFromResource(string source, float? desiredWidth, float? desiredHeight)
Parameters
sourcestringThe source resource, as a relative path.
desiredWidthfloat?Desired width.
desiredHeightfloat?Desired height.