internal VideoBrush(MediaPlayer player) { m_player = player; m_player.IsVideoReadyChanged += IsVideoReadyChangedCallback; SetBrush(); }
private void InitMediaPlayer() { m_player = m_presenter.Factory.CreateMediaPlayer(); m_player.Open(VIDEO_FILENAME); var videoBrush = m_presenter.Factory.CreateVideoBrush(m_player); videoBrush.HorizontalExtendMode = ExtendMode.Wrap; videoBrush.VerticalExtendMode = ExtendMode.Wrap; m_paintingBrush = videoBrush; }
/// <summary> /// Draws a MediaPlayer's video on to the DrawingLayer /// </summary> /// <param name="player">The MediaPlayer to draw</param> public void DrawMediaPlayer(MediaPlayer player) { m_drawStateManagement.DrawPreamble(); if (player.InternalBitmap == null) return; D2DRenderTarget.InternalRenderTarget.DrawBitmap(player.InternalBitmap); }
/// <summary> /// Draws a MediaPlayer's video on to the DrawingLayer /// </summary> /// <param name="player">The MediaPlayer to draw</param> /// <param name="destinationRectangle">The destination rectangle</param> /// <param name="opacity">The transparency level, 0 - 1</param> public void DrawMediaPlayer(MediaPlayer player, RectangleF destinationRectangle, float opacity) { m_drawStateManagement.DrawPreamble(); if (player.InternalBitmap == null) return; D2DRenderTarget.InternalRenderTarget.DrawBitmap(player.InternalBitmap, destinationRectangle.InternalRectangleF, opacity, InterpolationMode.Linear); }
public VideoBrush CreateVideoBrush(MediaPlayer player) { return new VideoBrush(player); }