public override void DrawRoundedRectangle(Brush brush, Pen pen, Rect rectangle, double radiusX, double radiusY) { RoundedRectangle roundedRect = new RoundedRectangle { Rect = rectangle.ToSharpDX(), RadiusX = (float)radiusX, RadiusY = (float)radiusY, }; if (brush != null) { using (var brush2D = brush.ToSharpDX(this.target)) { this.target.FillRoundedRectangle(roundedRect, brush2D); } } if (pen != null) { using (var brush2D = pen.Brush.ToSharpDX(this.target)) { this.target.DrawRoundedRectangle(roundedRect, brush2D, (float)pen.Thickness); } } }
public FormattedText( string textToFormat, CultureInfo culture, FlowDirection flowDirection, Typeface typeface, double emSize, Brush foreground) { this.Foreground = foreground; this.PlatformImpl = PlatformInterface.Instance.CreateFormattedText( textToFormat, typeface, emSize); this.Text = textToFormat; }
public override void DrawGeometry(Brush brush, Pen pen, Geometry geometry) { Direct2D1StreamGeometry platformGeometry = (Direct2D1StreamGeometry)geometry.PlatformImpl; PathGeometry d2dGeometry = platformGeometry.Direct2DGeometry; 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 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 void DrawRectangle(Brush brush, Pen pen, Rect rectangle) { if (brush != null) { using (var brush2D = brush.ToSharpDX(this.target)) { this.target.FillRectangle( rectangle.ToSharpDX(), brush2D); } } if (pen != null) { using (var brush2D = pen.Brush.ToSharpDX(this.target)) { this.target.DrawRectangle( rectangle.ToSharpDX(), brush2D, (float)pen.Thickness); } } }
public Pen(Brush brush, double thickness) { this.Brush = brush; this.Thickness = thickness; }
public abstract void DrawRoundedRectangle(Brush brush, Pen pen, Rect rectangle, double radiusX, double radiusY);
public abstract void DrawRectangle(Brush brush, Pen pen, Rect rectangle);
public abstract void DrawGeometry(Brush brush, Pen pen, Geometry geometry, Matrix transform);
public abstract void DrawGeometry(Brush brush, Pen pen, Geometry geometry);