当前位置: 首页>>代码示例>>C#>>正文


C# ImageInfo.GetThumbnail方法代码示例

本文整理汇总了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;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:18,代码来源:ImageSelector.cs

示例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 ();
        }
开发者ID:mono,项目名称:stetic,代码行数:82,代码来源:EditIconDialog.cs

示例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 ();
         }
     }
 }
开发者ID:mono,项目名称:stetic,代码行数:11,代码来源:EditIconDialog.cs


注:本文中的ImageInfo.GetThumbnail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。