DrawingContext.DrawVideo Method

Definition

Draw a video into the specified region.

Overloads

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.

C#
public abstract void DrawVideo(System.Windows.Media.MediaPlayer player, System.Windows.Rect rectangle);

Parameters

player
MediaPlayer

The media to draw.

rectangle
Rect

The region in which to draw player.

Remarks

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. 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.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 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

DrawVideo(MediaPlayer, Rect, AnimationClock)

Draws a video into the specified region and applies the specified animation clock.

C#
public abstract void DrawVideo(System.Windows.Media.MediaPlayer player, System.Windows.Rect rectangle, System.Windows.Media.Animation.AnimationClock rectangleAnimations);

Parameters

player
MediaPlayer

The media to draw.

rectangle
Rect

The area in which to draw the media.

rectangleAnimations
AnimationClock

The clock with which to animate the rectangle's size and dimensions, or null for no animation. This clock must be created from an AnimationTimeline that can animate Rect objects.

Remarks

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. 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.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 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