本文整理汇总了C#中ImageInfo.GetThumbnail方法的典型用法代码示例。如果您正苦于以下问题:C# ImageInfo.GetThumbnail方法的具体用法?C# ImageInfo.GetThumbnail怎么用?C# ImageInfo.GetThumbnail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageInfo
的用法示例。
在下文中一共展示了ImageInfo.GetThumbnail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
protected override void Initialize ()
{
base.Initialize ();
if (Property.PropertyType != typeof(ImageInfo))
throw new ApplicationException ("ImageSelector editor does not support editing values of type " + Property.PropertyType);
if (Instance == null)
return;
Stetic.ObjectWrapper w = Stetic.ObjectWrapper.Lookup (Instance);
project = w.Project;
imageInfo = (ImageInfo)Value;
if (imageInfo != null)
Image = imageInfo.GetThumbnail (project, ImageSize);
else
Image = null;
}
示例2: EditIconDialog
public EditIconDialog(IProject project, ProjectIconSet iconSet)
{
Glade.XML xml = new Glade.XML (null, "stetic.glade", "EditIconDialog", null);
xml.Autoconnect (this);
dialog.Response += OnResponse;
this.project = project;
this.iconSet = iconSet;
nameEntry.Text = iconSet.Name;
if (iconSet.Sources.Count == 0) {
radioSingle.Active = true;
imageLabel.Text = "";
}
else if (iconSet.Sources.Count == 1 && iconSet.Sources[0].AllWildcarded) {
radioSingle.Active = true;
singleIcon = iconSet.Sources[0].Image;
if (singleIcon != null) {
imageLabel.Text = singleIcon.Label;
imageImage.Pixbuf = singleIcon.GetThumbnail (project, 16);
} else
imageLabel.Text = "";
} else {
radioMultiple.Active = true;
}
hboxSingle.Sensitive = radioSingle.Active;
hboxMultiple.Sensitive = !radioSingle.Active;
// Build the tree
sourceListStore = new Gtk.ListStore (typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(object));
sourceList.Model = sourceListStore;
Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
Gtk.CellRendererPixbuf pr = new Gtk.CellRendererPixbuf ();
col.Title = Catalog.GetString ("Image");
col.PackStart (pr, false);
col.AddAttribute (pr, "pixbuf", 0);
Gtk.CellRendererText crt = new Gtk.CellRendererText ();
col.PackStart (crt, true);
col.AddAttribute (crt, "text", 1);
sourceList.AppendColumn (col);
col = new Gtk.TreeViewColumn ();
col.Expand = true;
col.Title = Catalog.GetString ("Size");
CellRendererComboBox crtb = new CellRendererComboBox ();
crtb.Changed += new ComboSelectionChangedHandler (OnSizeComboChanged);
crtb.Values = sizes;
col.PackStart (crtb, true);
col.AddAttribute (crtb, "text", 2);
sourceList.AppendColumn (col);
col = new Gtk.TreeViewColumn ();
col.Expand = true;
col.Title = Catalog.GetString ("State");
crtb = new CellRendererComboBox ();
crtb.Changed += new ComboSelectionChangedHandler (OnStateComboChanged);
crtb.Values = states;
col.PackStart (crtb, true);
col.AddAttribute (crtb, "text", 3);
sourceList.AppendColumn (col);
col = new Gtk.TreeViewColumn ();
col.Expand = true;
col.Title = Catalog.GetString ("Direction");
crtb = new CellRendererComboBox ();
crtb.Changed += new ComboSelectionChangedHandler (OnDirComboChanged);
crtb.Values = directions;
col.PackStart (crtb, true);
col.AddAttribute (crtb, "text", 4);
sourceList.AppendColumn (col);
foreach (ProjectIconSource source in iconSet.Sources)
AddSource (source);
UpdateButtons ();
}
示例3: OnSelectImage
protected void OnSelectImage(object s, EventArgs args)
{
using (SelectImageDialog dlg = new SelectImageDialog (dialog, project)) {
if (dlg.Run () == (int) Gtk.ResponseType.Ok) {
singleIcon = dlg.Icon;
imageLabel.Text = singleIcon.Label;
imageImage.Pixbuf = singleIcon.GetThumbnail (project, 16);
UpdateButtons ();
}
}
}