Esempio n. 1
0
        public Gdk.Pixbuf CreateIcon3D(Table3D table)
        {
            if (table.Zmin == table.Zmax)
            {
                return(GetNoDataPixBuf);
            }

            Plot3D.Draw(plotSurface, table);

            // Things like Padding needs to be set each time after Clear()
            plotSurface.Padding = padding;

            using (System.Drawing.Graphics g = Graphics.FromImage(bitmap_cache)) {
                plotSurface.Draw(g, bounds);
            }

            if (memoryStream == null)
            {
                memoryStream = new System.IO.MemoryStream(MemoryStreamCapacity);
            }
            memoryStream.Position = 0;
            bitmap_cache.Save(memoryStream, imageFormat);
            memoryStream.Position = 0;
            // TODO create Pixbuf directly from bitmap if possible, avoiding MemoryStream
            return(new Gdk.Pixbuf(memoryStream));
        }
Esempio n. 2
0
        public override Gdk.Pixbuf CreateIcon(Tables.Denso.Table table)
        {
            var t = (Tables.Denso.Table3D)table;

            if (t.IsDataConst)
            {
                return(ConstDataIcon);
            }

            Plot3D.Draw(plotSurface, t);
            return(DrawAndConvert());
        }