BitmapCache Constructors

Definition

Initializes a new instance of the BitmapCache class.

Overloads

BitmapCache()

Initializes a new instance of the BitmapCache class.

BitmapCache(Double)

Initializes a new instance of the BitmapCache class with the specified scale.

BitmapCache()

Initializes a new instance of the BitmapCache class.

C#
public BitmapCache();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

BitmapCache(Double)

Initializes a new instance of the BitmapCache class with the specified scale.

C#
public BitmapCache(double renderAtScale);

Parameters

renderAtScale
Double

A double that scales the bitmap.

Examples

The following XAML shows how to create and assign a BitmapCache to a Canvas element. For the complete code example, see How to: Improve Rendering Performance by Caching an Element.

XAML
<!-- //////////////////////////////////////////////////////////////// -->
<!-- // The following XAML creates a BitmapCache with default      // -->
<!-- // properties and assigns it as the CacheMode for the canvas. // -->
<!-- //////////////////////////////////////////////////////////////// -->
<Canvas.CacheMode>
    <BitmapCache EnableClearType="False" 
                 RenderAtScale="1" 
                 SnapsToDevicePixels="False"  />
</Canvas.CacheMode>

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10