Table of Contents

Class Imaging.BitmapMemoryPressure

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Adds memory pressure to a bitmap.

public class Imaging.BitmapMemoryPressure
Inheritance
Imaging.BitmapMemoryPressure
Inherited Members

Remarks

The .NET Bitmap class does not handle garbage collection very well, because most of the memory needed by such instances are unmanaged. This class provides memory management for Bitmap instances without the need to dispose each instance.

This is done by adding an object to the Tag property that tracks the unmanaged memory of the bitmap.

Methods

Add(Bitmap)

Adds memory pressure to the bitmap.

public static Bitmap Add(Bitmap b)

Parameters

b Bitmap

A bitmap image.

Returns

Bitmap

The bitmap with memory pressure added.

Add(Image)

Adds memory pressure to the image if it is a Bitmap.

public static Image Add(Image image)

Parameters

image Image

An image.

Returns

Image

The image with memory pressure added.

~BitmapMemoryPressure()

Finalizes an instance of this class.

protected ~BitmapMemoryPressure()

Remarks

Removes the GC memory pressure added for the associated bitmap.