public override void DrawGeometry(Brush brush, Pen pen, Geometry geometry, Avalonia.Media.Matrix transform) { Direct2D1StreamGeometry platformGeometry = (Direct2D1StreamGeometry)geometry.PlatformImpl; using (TransformedGeometry d2dGeometry = new TransformedGeometry( this.factory, platformGeometry.Direct2DGeometry, transform.ToSharpDX())) { if (brush != null) { this.target.FillGeometry(d2dGeometry, brush.ToSharpDX(this.target)); } if (pen != null) { this.target.DrawGeometry( d2dGeometry, pen.Brush.ToSharpDX(this.target), (float)pen.Thickness); } } }
public override IPlatformRenderTargetBitmap CreateRenderTargetBitmap( int pixelWidth, int pixelHeight, double dpiX, double dpiY, Avalonia.Media.PixelFormat pixelFormat) { SharpDX.WIC.Bitmap bitmap = new SharpDX.WIC.Bitmap( this.wicFactory, pixelWidth, pixelHeight, pixelFormat.ToSharpDX(), BitmapCreateCacheOption.CacheOnLoad); return new Direct2D1RenderTargetBitmap( this.Direct2DFactory, this.wicFactory, bitmap); }