public void DrawTo(IntPtr hdc) { if (!this.DesignMode) { if (window != null) { GraphicsWrapper gw = GraphicsWrapper.FromHdc(hdc, true); GdiRenderer r = ((GdiRenderer)window.Renderer); gw.Clear(r.BackColor); r.GraphicsWrapper = gw; window.Renderer.Render((SvgDocument)window.Document); r.GraphicsWrapper = null; gw.Dispose(); } } }