public GraphicsDeviceEventArgs(DeviceDescription description, GraphicsContext context = null) { this.description = description; this.context = context; }
public MetricsInfo GetMetricInfo(int character, GraphicsContext context, DeviceDescription description) { return(GetTextMetrics(character.ToString(CultureInfo.InvariantCulture), context, description)); }
public GraphicsDeviceEventArgs(DeviceDescription description, GraphicsContext context = null) { this.description = description; this.context = context; }
Rectangle IGraphicsDevice.GetSize(GraphicsContext context, DeviceDescription description) { return(description.ClipBounds); }
void IGraphicsDevice.DrawText(string s, Point location, double rotation, double adjustment, GraphicsContext context, DeviceDescription description) { var color = ConvertColor(context.Foreground); using (var g = CreateGraphics()) using (var brush = new SolidBrush(color)) { g.DrawString(s, Font, brush, ConvertPointF(location)); } }
double IGraphicsDevice.MeasureWidth(string s, GraphicsContext context, DeviceDescription description) { var metrics = GetTextMetrics(s, context, description); return(metrics.Width); }
void IGraphicsDevice.DrawRaster(Raster raster, Rectangle destination, double rotation, bool interpolated, GraphicsContext context, DeviceDescription description) { throw new NotImplementedException(); }
void IGraphicsDevice.DrawPath(IEnumerable <IEnumerable <Point> > points, bool winding, GraphicsContext context, DeviceDescription description) { var path = new GraphicsPath(); foreach (var vertices in points) { path.StartFigure(); path.AddLines(vertices.Select(ConvertPointF).ToArray()); } var color = ConvertColor(context.Foreground); using (var g = CreateGraphics()) using (var pen = new Pen(color)) { g.DrawPath(pen, path); } }