Cairo.Context.StrokeExtents C# (CSharp) Метод

StrokeExtents() публичный Метод

public StrokeExtents ( ) : Rectangle
Результат Rectangle
        public Rectangle StrokeExtents()
        {
            CheckDisposed ();
            double x1, y1, x2, y2;
            NativeMethods.cairo_stroke_extents (handle, out x1, out y1, out x2, out y2);
            return new Rectangle (x1, y1, x2 - x1, y2 - y1);
        }

Usage Example

Пример #1
0
        public static Rectangle DrawRectangle(this Cairo.Context g, Cairo.Rectangle r, Cairo.Color color, int lineWidth)
        {
            // Put it on a pixel line
            if (lineWidth == 1)
            {
                r = new Rectangle(r.X - 0.5, r.Y - 0.5, r.Width, r.Height);
            }

            g.Save();

            g.MoveTo(r.X, r.Y);
            g.LineTo(r.X + r.Width, r.Y);
            g.LineTo(r.X + r.Width, r.Y + r.Height);
            g.LineTo(r.X, r.Y + r.Height);
            g.LineTo(r.X, r.Y);

            g.Color     = color;
            g.LineWidth = lineWidth;
            g.LineCap   = LineCap.Square;

            Rectangle dirty = g.StrokeExtents();

            g.Stroke();

            g.Restore();

            return(dirty);
        }
All Usage Examples Of Cairo.Context::StrokeExtents