public static Gdk.Pixbuf GetAsPixbuf(this IDrawingCell aCell, bool aFramed) { int fw = (aFramed == true) ? 1 : 0; Cairo.ImageSurface surface = new Cairo.ImageSurface(Cairo.Format.RGB24, System.Convert.ToInt32(aCell.Area.Width + 2), System.Convert.ToInt32(aCell.Area.Height + 2)); Cairo.Context context = new Cairo.Context(surface); CellRectangle rect = new CellRectangle(0, 0, aCell.Area.Width + (fw * 2), aCell.Area.Height + (fw * 2)); context.Color = new Cairo.Color(1, 1, 1); rect.DrawPath(context); // context.Rectangle (rect); context.FillPreserve(); context.Color = new Cairo.Color(0, 0, 0); if (aFramed == true) { context.Stroke(); rect = new CellRectangle(1, 1, aCell.Area.Width + 1, aCell.Area.Height + 1); } CellRectangle fake = new CellRectangle(0, 0, 9999999, 9999999); CellExposeEventArgs args = new CellExposeEventArgs(null, context, null, fake, rect); args.NeedsRecalculation = true; aCell.Paint(args); Gdk.Pixbuf px = surface.GetAsPixbuf(); ((IDisposable)context.Target).Dispose(); ((IDisposable)context).Dispose(); ((IDisposable)surface).Dispose(); return(px); }