예제 #1
0
        public override void FillPolygon(Color c, List <Point> points)
        {
            Gdk.Point[] pointArray = new Gdk.Point[points.Count];
            for (int i = 0; i < points.Count; ++i)
            {
                pointArray[i].X = (int)points[i].X;
                pointArray[i].Y = (int)points[i].Y;
            }

            Gdk.GC g = new Gdk.GC(window);
            g.RgbFgColor = GdkColor(c);
            window.DrawPolygon(g, true, pointArray);
        }
예제 #2
0
        private void DrawSelectionRect(Gtk.Widget widget, Gdk.Window window)
        {
            Gdk.GC gc = (widget.Style.WhiteGC);
            gc.SetLineAttributes(1, LineStyle.OnOffDash, CapStyle.Butt, JoinStyle.Miter);
            gc.Function = Function.Xor;
            _selectionRect.Normalize();

            Gdk.Point[] points = new Gdk.Point[4];
            points [0] = new Gdk.Point((int)_selectionRect.X, (int)_selectionRect.Y);
            points [1] = new Gdk.Point((int)_selectionRect.X2, (int)_selectionRect.Y);
            points [2] = new Gdk.Point((int)_selectionRect.X2, (int)_selectionRect.Y2);
            points [3] = new Gdk.Point((int)_selectionRect.X, (int)_selectionRect.Y2);

            window.DrawPolygon(gc, false, points);
        }