RenderOptions.SetBitmapScalingMode 方法

定義

設定所指定相依性物件的 BitmapScalingMode 附加屬性值。

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)

參數

target
DependencyObject

要設定 BitmapScalingMode 屬性值的 UIElementDrawingGroup 下階。

bitmapScalingMode
BitmapScalingMode

要設定屬性的目標新值。

例外狀況

指定的 targetnull

範例

下列範例示範如何設定 BitmapScalingModeImage 物件的 。

// 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)

備註

SetBitmapScalingMode 以動畫顯示點陣圖的 UIElementDrawingGroup 子系上使用 方法。

建立任何點陣圖的比例動畫時,預設的高品質影像重新取樣演算法有時會耗用過多系統資源,導致畫面播放速率降低,從而造成動畫中斷。 藉由將 BitmapScalingMode 物件的 屬性 RenderOptions 設定為 LowQuality ,您可以在調整點陣圖時建立更順暢的動畫。

適用於

另請參閱