public void DrawContent(EditView view, Rectangle updateRect)
 {
     base.BegineDraw();
     view.Draw(updateRect);
     base.EndDraw();
     swapchain.Present(1, DXGI.PresentFlags.None);
 }
Пример #2
0
        public void DrawContent(EditView view, bool IsEnabled, Rectangle updateRect)
        {
            if (this.imageSource.IsFrontBufferAvailable)
            {
                this.imageSource.Lock();
                this.imageSource.SetBackBuffer(D3DResourceType.IDirect3DSurface9, this.surface9.NativePointer);

                base.BegineDraw();
                if (IsEnabled)
                {
                    view.Draw(updateRect);
                }
                else
                {
                    this.FillBackground(updateRect);
                }
                base.EndDraw();
                this.device.ImmediateContext.Flush();

                this.imageSource.AddDirtyRect(new Int32Rect(0, 0, (int)this.imageSource.PixelWidth, (int)this.imageSource.PixelHeight));
                this.imageSource.Unlock();
            }
        }