상속: IContext
예제 #1
0
 void Draw(Area area)
 {
     if (DrawEvent != null)
     {
         using (CairoContext c = new CairoContext(widget.GdkWindow)) {
             global::Cairo.Context cc = c.Value as global::Cairo.Context;
             if (area == null)
             {
                 Rectangle r = widget.GdkWindow.ClipRegion.Clipbox;
                 area = new Area(new Point(r.X, r.Y), r.Width, r.Height);
             }
             cc.Rectangle(area.Start.X, area.Start.Y, area.Width, area.Height);
             cc.Clip();
             DrawEvent(c, area);
         }
     }
 }
예제 #2
0
        public Image Copy(ICanvas canvas, Area area)
        {
            Image  img;
            Pixmap pm;

            global::Cairo.Context ctx;

            pm              = new Pixmap(null, (int)area.Width, (int)area.Height, 24);
            ctx             = Gdk.CairoHelper.Create(pm);
            disableScalling = true;
            using (CairoContext c = new CairoContext(ctx)) {
                ctx.Translate(-area.Start.X, -area.Start.Y);
                canvas.Draw(c, null);
            }
            disableScalling = false;
            img             = new Image(Pixbuf.FromDrawable(pm, Colormap.System, 0, 0, 0, 0,
                                                            (int)area.Width, (int)area.Height));
            return(img);
        }
예제 #3
0
        protected override void Render(Drawable window, Widget widget, Rectangle backgroundArea,
		                                Rectangle cellArea, Rectangle exposeArea, CellRendererState flags)
        {
            CellState state = (CellState)flags;

            using (IContext context = new CairoContext (window)) {
                Area bkg = new Area (new Point (backgroundArea.X, backgroundArea.Y),
                               backgroundArea.Width, backgroundArea.Height);
                Area cell = new Area (new Point (cellArea.X, cellArea.Y),
                                cellArea.Width, cellArea.Height);
                PlayslistCellRenderer.Render (Item, Count, IsExpanded, Config.DrawingToolkit,
                    context, bkg, cell, state);
            }
        }
예제 #4
0
 void Draw(Area area)
 {
     if (DrawEvent != null) {
         using (CairoContext c = new CairoContext (widget.GdkWindow)) {
             global::Cairo.Context cc = c.Value as global::Cairo.Context;
             if (area == null) {
                 Rectangle r = widget.GdkWindow.ClipRegion.Clipbox;
                 area = new Area (new Point (r.X, r.Y), r.Width, r.Height);
             }
             cc.Rectangle (area.Start.X, area.Start.Y, area.Width, area.Height);
             cc.Clip ();
             DrawEvent (c, area);
         }
     }
 }