DrawingContext.DrawVideo 方法

定義

將視訊繪製至指定的區域。Draw a video into the specified region.

多載

DrawVideo(MediaPlayer, Rect)

將視訊繪製至指定的區域。Draws a video into the specified region.

DrawVideo(MediaPlayer, Rect, AnimationClock)

將視訊繪製至指定的區域,然後套用指定的動作時鐘。Draws a video into the specified region and applies the specified animation clock.

DrawVideo(MediaPlayer, Rect)

將視訊繪製至指定的區域。Draws a video into the specified region.

public:
 abstract void DrawVideo(System::Windows::Media::MediaPlayer ^ player, System::Windows::Rect rectangle);
public abstract void DrawVideo (System.Windows.Media.MediaPlayer player, System.Windows.Rect rectangle);
abstract member DrawVideo : System.Windows.Media.MediaPlayer * System.Windows.Rect -> unit
Public MustOverride Sub DrawVideo (player As MediaPlayer, rectangle As Rect)

參數

player
MediaPlayer

要繪製的媒體。The media to draw.

rectangle
Rect

要在其中繪製 player 的區域。The region in which to draw player.

備註

請注意,媒體將會延展,以放入矩形參數所定義的區域內。Note that the media will be stretched to fit inside the area defined by the rectangle parameter. 如果矩形和媒體的外觀比例不同,則會發生失真。If rectangle and media have different aspect ratios, distortion will occur. 若要更充分掌控媒體如何用來填滿區域,請使用 DrawRectangle 命令來繪製矩形,並以包含媒體的 VisualBrush 填入。For more control over how media is used to fill an area, use the DrawRectangle command to draw a rectangle and fill it with a VisualBrush that contains media.

DrawVideo(MediaPlayer, Rect, AnimationClock)

將視訊繪製至指定的區域,然後套用指定的動作時鐘。Draws a video into the specified region and applies the specified animation clock.

public:
 abstract void DrawVideo(System::Windows::Media::MediaPlayer ^ player, System::Windows::Rect rectangle, System::Windows::Media::Animation::AnimationClock ^ rectangleAnimations);
public abstract void DrawVideo (System.Windows.Media.MediaPlayer player, System.Windows.Rect rectangle, System.Windows.Media.Animation.AnimationClock rectangleAnimations);
abstract member DrawVideo : System.Windows.Media.MediaPlayer * System.Windows.Rect * System.Windows.Media.Animation.AnimationClock -> unit
Public MustOverride Sub DrawVideo (player As MediaPlayer, rectangle As Rect, rectangleAnimations As AnimationClock)

參數

player
MediaPlayer

要繪製的媒體。The media to draw.

rectangle
Rect

要在其中繪製媒體的區域。The area in which to draw the media.

rectangleAnimations
AnimationClock

用來建立矩形大小和維度動畫的時鐘,不使用動畫則為 nullThe clock with which to animate the rectangle's size and dimensions, or null for no animation. 這個時鐘必須從可以將 AnimationTimeline 物件顯示為動畫的 Rect 建立。This clock must be created from an AnimationTimeline that can animate Rect objects.

備註

請注意,媒體將會延展,以放入矩形參數所定義的區域內。Note that the media will be stretched to fit inside the area defined by the rectangle parameter. 如果矩形和媒體的外觀比例不同,則會發生失真。If rectangle and media have different aspect ratios, distortion will occur. 若要更充分掌控媒體如何用來填滿區域,請使用 DrawRectangle 命令來繪製矩形,並以包含媒體的 VisualBrush 填入。For more control over how media is used to fill an area, use the DrawRectangle command to draw a rectangle and fill it with a VisualBrush that contains media.

適用於