BitmapImage Class

Definition

An abstract class for a bitmap image, to be implemented by an image provider. This class is also the factory to create new bitmaps with the current image factory. The image factory must implement IImageFactory and must be registered using a call to RegisterImageFactory(IImageFactory).

public abstract class BitmapImage
public abstract class BitmapImage : IDisposable
type BitmapImage = class
type BitmapImage = class
    interface IDisposable
Public MustInherit Class BitmapImage
Public MustInherit Class BitmapImage
Implements IDisposable
Inheritance
BitmapImage
Implements

Remarks

This class does not have an implementation within Iot.Device.Bindings.dll. You can use the Iot.Device.Bindings.SkiaSharpAdapter.dll as a supported operating-system independent implementation of this class or write your own implementation.

Constructors

BitmapImage(Byte[], Int32, Int32, Int32)

Initializes a BitmapImage instance with the specified data, width, height and stride.

BitmapImage(Int32, Int32, Int32, PixelFormat)

Initializes a BitmapImage instance with the specified data, width, height and stride.

Properties

Data

Data related to the image (derived class defines a specific format)

Height

Height of the image

Item[Int32, Int32]

Accesses the pixel at the given position

PixelFormat

The format of the image

Stride

Number of bytes per row

Width

Width of the image

Methods

AsByteSpan()

Return the data pointer as a raw span of bytes

Clear(Color)

Clears the image to specific color

CreateBitmap(Int32, Int32, PixelFormat)

Creates a bitmap using the active factory. This requires an implementation to be registered. See BitmapImage for details.

CreateFromFile(String)

Create a bitmap from a file. This requires an implementation to be registered. See BitmapImage for details.

CreateFromStream(Stream)

Create a bitmap from an open stream. This requires an implementation to be registered. See BitmapImage for details.

Dispose()

Disposes this instance. Correctly disposing instance of this class is important to prevent memory leaks or overload of the garbage collector.

Dispose(Boolean)

Disposes this instance

GetDrawingApi()

Returns an abstraction interface for drawing to this bitmap.

GetPixel(Int32, Int32)

Gets the color of the pixel at the given position

RegisterImageFactory(IImageFactory)

Register an image factory.

SaveToFile(String, ImageFileType)

Saves this bitmap to a file

SaveToStream(Stream, ImageFileType)

Save the image to a stream

SetPixel(Int32, Int32, Color)

Sets pixel at specific position

Applies to