示例#1
0
 public GraphicsDeviceEventArgs(DeviceDescription description, GraphicsContext context = null)
 {
     this.description = description;
     this.context     = context;
 }
示例#2
0
 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;
 }
示例#4
0
 Rectangle IGraphicsDevice.GetSize(GraphicsContext context, DeviceDescription description)
 {
     return(description.ClipBounds);
 }
示例#5
0
        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));
                }
        }
示例#6
0
        double IGraphicsDevice.MeasureWidth(string s, GraphicsContext context, DeviceDescription description)
        {
            var metrics = GetTextMetrics(s, context, description);

            return(metrics.Width);
        }
示例#7
0
 void IGraphicsDevice.DrawRaster(Raster raster, Rectangle destination, double rotation, bool interpolated, GraphicsContext context, DeviceDescription description)
 {
     throw new NotImplementedException();
 }
示例#8
0
        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);
                }
        }