Table of Contents

Class DynamicBitmap<T>

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

Represents a dynamic bitmap that supports lazy initialization, scaling, and transparency.

public abstract class DynamicBitmap<T> : DisposableObject, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IDisposable, IBaseObject where T : class, IDisposableObject

Type Parameters

T

The type of the underlying bitmap resource, which must implement IDisposableObject.

Inheritance
DynamicBitmap<T>
Implements
Derived

Remarks

This class provides a base implementation for managing a bitmap resource that can be dynamically resized, scaled, and configured for transparency. The bitmap is lazily created on first access and disposed of when the properties affecting its state are modified. Derived classes must implement the CreateBitmap() method to define how the bitmap resource is created.

Constructors

DynamicBitmap()

Initializes a new instance of the DynamicBitmap class.

DynamicBitmap(SizeD, float, bool)

Initializes a new instance of the DynamicBitmap class.

Properties

Bitmap

Gets the bitmap, creating it if necessary.

IsTransparent

Gets or sets a value indicating whether the bitmap canvas is transparent.

ScaleFactor

Gets or sets the scale factor used for the bitmap canvas.

Size

Gets or sets the size of the bitmap canvas in device-independent units.

SizeInPixels

Gets the size of the bitmap in pixels, adjusted for the ScaleFactor.

Methods

CreateBitmap()

Creates and returns a new bitmap instance.

DisposeBitmap()

Releases the resources used by the bitmap object and sets it to null.

DisposeManaged()

Override to dispose managed resources. Here we dispose all used object references.

Equals(SizeD, float, bool)

Determines whether the specified size, scale factor, and transparency flag are equal to those used in the current instance.

SetDynamicProperties(SizeD, float, bool)

Updates the dynamic properties of the object, including size, scale factor, and transparency.