コード例 #1
0
ファイル: VideoBrush.cs プロジェクト: treytomes/DirectCanvas
 internal VideoBrush(MediaPlayer player)
 {
     m_player = player;
     m_player.IsVideoReadyChanged += IsVideoReadyChangedCallback;
     
     SetBrush();
 }
コード例 #2
0
ファイル: SuperBlur.cs プロジェクト: treytomes/DirectCanvas
 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;
 }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
 public VideoBrush CreateVideoBrush(MediaPlayer player)
 {
     return new VideoBrush(player);
 }