public Graphics CreateGdiGraphics() { IntPtr hdc = gdiRenderTarget.GetDC(DeviceContextInitializeMode.Copy); Graphics gdiGraphics = Graphics.FromHdc(hdc); gdiGraphics.Transform = layer.GlobalMatrix; return(gdiGraphics); }
protected override void OnPostDraw() { using (GdiInteropRenderTarget gdi = XResource.RenderTarget.QueryInterface <GdiInteropRenderTarget>()) { var hdc = gdi.GetDC(DeviceContextInitializeMode.Copy); layeredWindowCtx.Draw(Handle, hdc); gdi.ReleaseDC(null); } }
protected internal override void Draw(RenderTarget renderTarget) { if (gdiRenderTarget != null) { IntPtr dc = gdiRenderTarget.GetDC(DCInitializeMode.Copy); Graphics g = Graphics.FromHdc(dc); foreach (var ellipse in ellipses) { g.DrawEllipse(ellipse.pen, ellipse.rect); } g.Dispose(); gdiRenderTarget.ReleaseDC(); } }