示例#1
0
        private void SetBrush()
        {
            if(InternalBrush != null)
                InternalBrush.Dispose();

            if (m_player.IsVideoReady)
            {
                m_bitmapBrush = new SlimDX.Direct2D.BitmapBrush(m_player.ResourceOwner.InternalRenderTarget,
                                                                m_player.InternalBitmap);

                m_bitmapBrush.HorizontalExtendMode = (SlimDX.Direct2D.ExtendMode)HorizontalExtendMode;
                m_bitmapBrush.VerticalExtendMode = (SlimDX.Direct2D.ExtendMode)VerticalExtendMode;
            }
            else
                m_solidColorBrush = new SlimDX.Direct2D.SolidColorBrush(m_player.ResourceOwner.InternalRenderTarget, 
                                                                        new Color4(1, 0, 0, 0).InternalColor4);
        }
示例#2
0
 internal DrawingLayerBrush(DrawingLayer drawingLayer)
 {
     m_drawingLayer = drawingLayer;
     m_internalBitmapBrush = new SlimDX.Direct2D.BitmapBrush(drawingLayer.D2DRenderTarget.InternalRenderTarget, 
                                                             drawingLayer.D2DRenderTarget.InternalBitmap);
 }
示例#3
0
        public override void Dispose()
        {
            if(m_bitmapBrush != null)
            {
                m_bitmapBrush.Dispose();
                m_bitmapBrush = null;
            }

            if(m_solidColorBrush != null)
            {
                m_solidColorBrush.Dispose();
            }

            if(m_player != null)
            {
                m_player.IsVideoReadyChanged -= IsVideoReadyChangedCallback;
            }

            base.Dispose();
        }