DrawingContext.DrawVideo Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
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)
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 |
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)
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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: