RenderOptions.SetBitmapScalingMode Méthode

Définition

Définit la valeur de la propriété attachée BitmapScalingMode sur un objet de dépendance spécifié.

public:
 static void SetBitmapScalingMode(System::Windows::DependencyObject ^ target, System::Windows::Media::BitmapScalingMode bitmapScalingMode);
public static void SetBitmapScalingMode (System.Windows.DependencyObject target, System.Windows.Media.BitmapScalingMode bitmapScalingMode);
static member SetBitmapScalingMode : System.Windows.DependencyObject * System.Windows.Media.BitmapScalingMode -> unit
Public Shared Sub SetBitmapScalingMode (target As DependencyObject, bitmapScalingMode As BitmapScalingMode)

Paramètres

target
DependencyObject

Descendant UIElement ou DrawingGroup sur lequel définir la valeur de la propriété BitmapScalingMode.

bitmapScalingMode
BitmapScalingMode

Nouvelle valeur à affecter à la propriété.

Exceptions

Le target spécifié a la valeur null.

Exemples

L’exemple suivant montre comment définir l’objet BitmapScalingMode pour un Image objet.

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

Remarques

Utilisez la SetBitmapScalingMode méthode sur un UIElement ou DrawingGroup un descendant qui anime une bitmap.

Quand vous animez l’échelle d’une image bitmap, l’algorithme de rééchantillonnage d’image haute qualité par défaut peut parfois consommer une quantité de ressources système telle que la fréquence d’images se dégrade et les animations deviennent saccadées. En définissant la propriété de l’objet LowQualityRenderOptions sur , vous pouvez créer une animation plus fluide lors de la mise à l’échelle BitmapScalingMode d’une bitmap.

S’applique à

Voir aussi