public override void SetImage(Gtk.Image imageView)
        {
            using (var drawable = new Gdk.Pixmap(null, Size.Width, Size.Height, 24))
                using (var gc = new Gdk.GC(drawable)) {
                    drawable.Colormap = new Gdk.Colormap(Gdk.Visual.System, true);


                    drawable.DrawIndexedImage(gc, 0, 0, Size.Width, Size.Height, Gdk.RgbDither.None, Control, this.rowStride, GetPmap());
                    imageView.Pixmap = drawable;
                }
        }
Example #2
0
        public override void SetImage(Gtk.Image imageView, Gtk.IconSize?iconSize)
        {
            using (var drawable = new Gdk.Pixmap(null, Size.Width, Size.Height, 24))
                using (var gc = new Gdk.GC(drawable)) {
                    drawable.Colormap = new Gdk.Colormap(Gdk.Visual.System, true);


                    drawable.DrawIndexedImage(gc, 0, 0, Size.Width, Size.Height, Gdk.RgbDither.None, Control, rowStride, GetPmap());

                    if (iconSize != null)
                    {
                        var iconSet = new Gtk.IconSet(Gdk.Pixbuf.FromDrawable(drawable, Gdk.Colormap.System, 0, 0, 0, 0, size.Width, size.Height));
                        imageView.SetFromIconSet(iconSet, iconSize.Value);
                    }
                    else
                    {
                        imageView.Pixmap = drawable;
                    }
                }
        }