Ejemplo n.º 1
0
		public override void SetImage(Gtk.Image imageView, Gtk.IconSize? iconSize)
		{
			if (iconSize != null)
				imageView.SetFromIconSet(Control, iconSize.Value);
			else
				imageView.Pixbuf = Pixbuf;
		}
Ejemplo n.º 2
0
 public override void SetImage(Gtk.Image imageView, Gtk.IconSize?iconSize)
 {
     if (iconSize != null)
     {
         imageView.SetFromIconSet(new Gtk.IconSet(Control), iconSize.Value);
     }
     else
     {
         imageView.Pixbuf = Control;
     }
 }
Ejemplo n.º 3
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;
                    }
                }
        }