This topic has not yet been rated - Rate this topic

BitmapScalingMode Enumeration

Specifies which algorithm is used to scale bitmap images.

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)
public enum BitmapScalingMode
<object property="enumerationMemberName" .../>
Member name Description
Unspecified Use the default bitmap scaling mode, which is Linear.
LowQuality Use bilinear bitmap scaling, which is faster than HighQuality mode, but produces lower quality output. The LowQuality mode is the same as the Linear mode.
HighQuality Use high quality bitmap scaling, which is slower than LowQuality mode, but produces higher quality output. The HighQuality mode is the same as the Fant mode.
Linear Use linear bitmap scaling, which is faster than HighQuality mode, but produces lower quality output.
Fant Use very high quality Fant bitmap scaling, which is slower than all other bitmap scaling modes, but produces higher quality output.
NearestNeighbor Use nearest-neighbor bitmap scaling, which provides performance benefits over LowQuality mode when the software rasterizer is used. This mode is often used to magnify a bitmap.

When animating the scale of any bitmap, the default high-quality image re-sampling algorithm can sometimes consume sufficient system resources to cause frame rate degradation. This frame rate degradation can cause animations to skip frames or stutter. By setting the BitmapScalingMode property of the RenderOptions object to LowQuality you can create a smoother animation when scaling a bitmap.

The following example shows how to set the BitmapScalingMode for an image object.


// Set the bitmap scaling mode for the image to render faster.
RenderOptions.SetBitmapScalingMode(MyImage, BitmapScalingMode.LowQuality);


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ