Exemple #1
0
 protected override GLib.Value GetValueInternal(object dataItem, int dataColumn, int row)
 {
     if (Widget.Binding != null)
     {
         var ret   = Widget.Binding.GetValue(dataItem);
         var image = ret as Image;
         if (image != null)
         {
             return(new GLib.Value(((IGtkPixbuf)image.Handler).GetPixbuf(new Size(16, 16), ImageInterpolation.ToGdk())));
         }
     }
     return(new GLib.Value((Gdk.Pixbuf)null));
 }
Exemple #2
0
        public void Create(Image image, int width, int height, ImageInterpolation interpolation)
        {
            var pixbuf = image.ToGdk();

            Control = pixbuf.ScaleSimple(width, height, interpolation.ToGdk());
        }
 protected override GLib.Value GetValueInternal(object dataItem, int dataColumn, int row)
 {
     if (dataColumn == imageDataIndex)
     {
         if (Widget.ImageBinding != null)
         {
             var ret   = Widget.ImageBinding.GetValue(dataItem);
             var image = ret as Image;
             if (image != null)
             {
                 return(new GLib.Value(((IGtkPixbuf)image.Handler).GetPixbuf(new Size(16, 16), ImageInterpolation.ToGdk())));
             }
         }
         return(new GLib.Value((Gdk.Pixbuf)null));
     }
     if (dataColumn == textDataIndex)
     {
         var ret = Widget.TextBinding.GetValue(dataItem);
         if (ret != null)
         {
             return(new GLib.Value(Convert.ToString(ret)));
         }
     }
     return(new GLib.Value((string)null));
 }