示例#1
0
        public static void CurvedRectangle(Cairo.Context c, RectangleD rect, double radius)
        {
            if (rect.Width < (radius * 2.0))
            {
                radius = rect.Width / 2.0;
            }

            if (rect.Height < (radius * 2.0))
            {
                radius = rect.Height / 2.0;
            }

            c.MoveTo(rect.X, rect.Y + radius);
            c.LineTo(rect.X, rect.Y2 - radius);
            c.CurveTo(rect.X, rect.Y2 - radius, rect.X, rect.Y2, rect.X + radius, rect.Y2);
            c.LineTo(rect.X2 - radius, rect.Y2);
            c.CurveTo(rect.X2 - radius, rect.Y2, rect.X2, rect.Y2, rect.X2, rect.Y2 - radius);
            c.LineTo(rect.X2, rect.Y + radius);
            c.CurveTo(rect.X2, rect.Y + radius, rect.X2, rect.Y, rect.X2 - radius, rect.Y);
            c.LineTo(rect.X + radius, rect.Y);
            c.CurveTo(rect.X + radius, rect.Y, rect.X, rect.Y, rect.X, rect.Y + radius);
            c.ClosePath();
        }
示例#2
0
 public static Gdk.Rectangle GdkRectangle(RectangleD r)
 {
     return(new Gdk.Rectangle((int)r.X, (int)r.Y, (int)r.Width, (int)r.Height));
 }
示例#3
0
 public static Cairo.Rectangle CairoRectangle(RectangleD r)
 {
     return(new Cairo.Rectangle(r.X, r.Y, r.Width, r.Height));
 }
示例#4
0
        public static void AngleFrame(Cairo.Context c, Gdk.Rectangle gdkRect, double angleLeft, double angleTop, double angleRight, double angleBottom)
        {
            RectangleD rect = new RectangleD(gdkRect.X, gdkRect.Y, gdkRect.Width, gdkRect.Height);

            AngleFrame(c, rect, angleLeft, angleTop, angleRight, angleBottom);
        }