• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IPhoto类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IPhoto的典型用法代码示例。如果您正苦于以下问题:C# IPhoto类的具体用法?C# IPhoto怎么用?C# IPhoto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IPhoto类属于命名空间,在下文中一共展示了IPhoto类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Populate

    public void Populate(IPhoto [] photos)
    {
        Dictionary<uint, Tag> dict = new Dictionary<uint, Tag> ();
        if (photos != null) {
            foreach (IPhoto p in photos) {
                foreach (Tag t in p.Tags) {
                    if (!dict.ContainsKey (t.Id)) {
                        dict.Add (t.Id, t);
                    }
                }
            }
        }

        foreach (Widget w in this.Children) {
            w.Destroy ();
        }

        if (dict.Count == 0) {
            /* Fixme this should really set parent menu
               items insensitve */
            MenuItem item = new MenuItem (Mono.Unix.Catalog.GetString ("(No Tags)"));
            this.Append (item);
            item.Sensitive = false;
            item.ShowAll ();
            return;
        }

        foreach (Tag t in dict.Values) {
            MenuItem item = new TagMenu.TagMenuItem (t);
            this.Append (item);
            item.ShowAll ();
            item.Activated += HandleActivate;
        }
    }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:34,代码来源:PhotoTagMenu.cs


示例2: CopyIfNeeded

		public void CopyIfNeeded (IPhoto item, SafeUri destinationBase)
		{
			// remember source uri for copying xmp file
			SafeUri defaultVersionUri = item.DefaultVersion.Uri;

			foreach (IPhotoVersion version in item.Versions) {
				// Copy into photo folder and update IPhotoVersion uri
				var source = version.Uri;
				var destination = destinationBase.Append (source.GetFilename ());
				if (!source.Equals (destination)) {
					destination = GetUniqueFilename (destination);
					file_system.File.Copy (source, destination, false);
					copied_files.Add (destination);
					original_files.Add (source);
					version.Uri = destination;
				}
			}

			// Copy XMP sidecar
			var xmp_original = defaultVersionUri.ReplaceExtension(".xmp");
			if (file_system.File.Exists (xmp_original)) {
				var xmp_destination = item.DefaultVersion.Uri.ReplaceExtension (".xmp");
				file_system.File.Copy (xmp_original, xmp_destination, true);
				copied_files.Add (xmp_destination);
				original_files.Add (xmp_original);
			}
		}
开发者ID:cizma,项目名称:f-spot,代码行数:27,代码来源:PhotoFileTracker.cs


示例3: LoadAtMaxSize

 public static Gdk.Pixbuf LoadAtMaxSize(IPhoto item, int width, int height)
 {
     using (var img = ImageFile.Create (item.DefaultVersion.Uri)) {
         Gdk.Pixbuf pixbuf = img.Load (width, height);
         return pixbuf;
     }
 }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:7,代码来源:PhotoLoader.cs


示例4: PhotoVersionMenu

    public PhotoVersionMenu(IPhoto photo)
    {
        Version = photo.DefaultVersion;

        version_mapping = new Dictionary<MenuItem, IPhotoVersion> ();

        foreach (IPhotoVersion version in photo.Versions) {
            MenuItem menu_item = new MenuItem (version.Name);
            menu_item.Show ();
            menu_item.Sensitive = true;
            Gtk.Label child = ((Gtk.Label) menu_item.Child);

            if (version == photo.DefaultVersion) {
                child.UseMarkup = true;
                child.Markup = String.Format ("<b>{0}</b>", version.Name);
            }

            version_mapping.Add (menu_item, version);

            Append (menu_item);
        }

        if (version_mapping.Count == 1) {
            MenuItem no_edits_menu_item = new MenuItem (Mono.Unix.Catalog.GetString ("(No Edits)"));
            no_edits_menu_item.Show ();
            no_edits_menu_item.Sensitive = false;
            Append (no_edits_menu_item);
        }
    }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:29,代码来源:PhotoVersionMenu.cs


示例5: BrowsablePointerChangedEventArgs

 public BrowsablePointerChangedEventArgs(IPhoto previous_item, int previous_index, IBrowsableItemChanges changes)
     : base()
 {
     PreviousItem = previous_item;
     PreviousIndex = previous_index;
     Changes = changes;
 }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:7,代码来源:BrowsablePointerChangedEventArgs.cs


示例6: ProductsController

 public ProductsController(INews news, IModule module, IPhoto photo, ICacheManager cache)
 {
     _news = news;
     _module = module;
     _cache = cache;
     _photo = photo;
 }
开发者ID:nozerowu,项目名称:ABP,代码行数:7,代码来源:ProductsController.cs


示例7: Save

        public void Save(IPhoto tempImageStorage, IImageFormatSpec mediaFormat, out bool success)
        {
            success = false;
            Checks.Argument.IsNotNull(tempImageStorage, "tempImageStorage");
            Checks.Argument.IsNotNull(mediaFormat, "mediaFormat");
            Checks.Argument.IsNotNull(_tempImageStorageRepository, "_tempImageStorageRepository");


            //ValidateTempImageStorage(tempImageStorage, out validationState);

            //if (!validationState.IsValid)
            //{
            //    return;
            //}

            if (null == this.GetImage(tempImageStorage.PhotoId))
            {
                try
                {

                    _tempImageStorageRepository.Add(tempImageStorage);
                    success = true;
                }
                catch (Exception ex)
                {
                    success = false;
                    //var valState = new ValidationState();
                    //valState.Errors.Add(new ValidationError("Id.AlreadyExists", tempImageStorage, ex.Message));
                    //validationState.Append(typeof(ITempImageStorage), valState);
                }
            }

        }
开发者ID:coredweller,项目名称:PhishMarket,代码行数:33,代码来源:TempImageStorageService.cs


示例8: PrintOperation

 public PrintOperation(IPhoto [] selected_photos)
 {
     this.selected_photos = selected_photos;
     CustomTabLabel = Catalog.GetString ("Image Settings");
     NPages = selected_photos.Length;
     DefaultPageSetup = Global.PageSetup;
 }
开发者ID:GNOME,项目名称:f-spot,代码行数:7,代码来源:PrintOperation.cs


示例9: Execute

    public bool Execute(IPhoto [] photos)
    {
        ProgressDialog progress_dialog = null;
        var loader = ThumbnailLoader.Default;
        if (photos.Length > 1) {
            progress_dialog = new ProgressDialog (Mono.Unix.Catalog.GetString ("Updating Thumbnails"),
                                  ProgressDialog.CancelButtonType.Stop,
                                  photos.Length, parent_window);
        }

        int count = 0;
        foreach (IPhoto photo in photos) {
            if (progress_dialog != null
                && progress_dialog.Update (String.Format (Mono.Unix.Catalog.GetString ("Updating picture \"{0}\""), photo.Name)))
                break;

            foreach (IPhotoVersion version in photo.Versions) {
                loader.Request (version.Uri, ThumbnailSize.Large, 10);
            }

            count++;
        }

        if (progress_dialog != null)
            progress_dialog.Destroy ();

        return true;
    }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:28,代码来源:ThumbnailCommand.cs


示例10: Load

 public static Gdk.Pixbuf Load(IPhoto item)
 {
     using (var img = ImageFile.Create (item.DefaultVersion.Uri)) {
         Gdk.Pixbuf pixbuf = img.Load ();
         return pixbuf;
     }
 }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:7,代码来源:PhotoLoader.cs


示例11: Render

        public override void Render(Drawable window,
                                     Widget widget,
                                     Rectangle cell_area,
                                     Rectangle expose_area,
                                     StateType cell_state,
                                     IPhoto photo)
        {
            string text = GetRenderText (photo);

            var layout = new Pango.Layout (widget.PangoContext);
            layout.SetText (text);

            Rectangle layout_bounds;
            layout.GetPixelSize (out layout_bounds.Width, out layout_bounds.Height);

            layout_bounds.Y = cell_area.Y;
            layout_bounds.X = cell_area.X + (cell_area.Width - layout_bounds.Width) / 2;

            if (layout_bounds.IntersectsWith (expose_area)) {
                Style.PaintLayout (widget.Style, window, cell_state,
                                   true, expose_area, widget, "IconView",
                                   layout_bounds.X, layout_bounds.Y,
                                   layout);
            }
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:25,代码来源:ThumbnailTextCaptionRenderer.cs


示例12: Photo

 public Photo(IPhoto photo)
 {
     PhotoId = photo.PhotoId;
     PhotoName = photo.PhotoName;
     PhotoType = photo.PhotoType;
     PhotoPath = photo.PhotoPath;
     GalleryId = photo.GalleryId;
 }
开发者ID:ebi-igweze,项目名称:MvcAndAngular,代码行数:8,代码来源:Photo.cs


示例13: InvalidateThumbnail

        public void InvalidateThumbnail (IPhoto photo)
        {
            PhotoGridViewChild child = GetDrawingChild (photo);

            if (child != null) {
                child.InvalidateThumbnail ();
                View.QueueDraw ();
            }
        }
开发者ID:rubenv,项目名称:tripod,代码行数:9,代码来源:PhotoGridViewLayout.cs


示例14: ViewPhotoForm

 /// <summary>
 /// Initializes a new instance of the <see cref="ViewPhotoForm"/> class.
 /// </summary>
 /// <param name="currentAlbum">The album whose photos the user is viewing.</param>
 /// <param name="photoToDisplay">the specific photo to view.</param>
 /// <remarks>
 /// Author(s): Miguel Gonzales and Andrea Tan
 /// </remarks>
 public ViewPhotoForm(IAlbum currentAlbum, IPhoto photoToDisplay)
 {
     this.InitializeComponent();
     this.album = currentAlbum;
     this.Text = this.album.AlbumId + " - Photo Buddy";
     this.allPhotosInAlbum = new List<IPhoto>(this.album.Photos);
     this.photoIndex = this.allPhotosInAlbum.IndexOf(photoToDisplay);
     this.DisplayPhoto(this.photoIndex);
 }
开发者ID:jamesrcounts,项目名称:CS441,代码行数:17,代码来源:ViewPhotoForm.cs


示例15: GetDrawingChild

        protected PhotoGridViewChild GetDrawingChild (IPhoto photo)
        {
            foreach (PhotoGridViewChild child in Children) {
                if (child != null && child.BoundPhoto == photo) {
                    return child;
                }
            }

            return null;
        }
开发者ID:rubenv,项目名称:tripod,代码行数:10,代码来源:PhotoGridViewLayout.cs


示例16: PhotoVersion

 public PhotoVersion(IPhoto photo, uint version_id, SafeUri base_uri, string filename, string md5_sum, string name, bool is_protected)
 {
     Photo = photo;
     VersionId = version_id;
     BaseUri = base_uri;
     Filename = filename;
     ImportMD5 = md5_sum;
     Name = name;
     IsProtected = is_protected;
 }
开发者ID:GNOME,项目名称:f-spot,代码行数:10,代码来源:PhotoVersion.cs


示例17: SaveCommit

 public void SaveCommit(IPhoto photo, out bool success)
 {
     using (var unitOfWork = UnitOfWork.Begin())
     {
         Save(photo, out success);
         if (success)
         {
             unitOfWork.Commit();
         }
     }
 }
开发者ID:coredweller,项目名称:PhishMarket,代码行数:11,代码来源:PhotoService.cs


示例18: UploadViewForm

        /// <summary>
        /// Initializes a new instance of the <see cref="UploadViewForm"/> class.
        /// </summary>
        /// <param name="photo">The photo to display.</param>
        /// <remarks>
        ///   <para>Author: Jim Counts and Eric Wei</para>
        ///   <para>Created: 2011-10-25</para>
        ///   <para>Modified: 2011-10-25</para>
        ///   <para>
        /// Creates an instance of the UploadViewForm that is configured to rename a photo.
        ///   </para>
        /// </remarks>
        public UploadViewForm(IPhoto photo)
        {
            this.InitializeComponent();

            Album = photo.Album;

            this.Text = Format.Culture("{0} {1} - Photo Buddy", "Rename", photo.DisplayName);
            this.UploadViewBox.Image = photo.Image;
            this.displayNameTextBox.Text = photo.DisplayName;
            this.messageLabel.Text = "This is the photo you have selected to rename.";
        }
开发者ID:jamesrcounts,项目名称:CS441,代码行数:23,代码来源:UploadViewForm.cs


示例19: Compare

        public static int Compare(this IPhoto photo1, IPhoto photo2)
        {
            int result = photo1.CompareDate (photo2);

            if (result == 0)
                result = CompareDefaultVersionUri (photo1, photo2);

            if (result == 0)
                result = photo1.CompareName (photo2);

            return result;
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:12,代码来源:IPhotoExtensions.cs


示例20: LoadMipMap

        public static MipMapFile LoadMipMap (IPhoto photo)
        {
            var mipmap_uri = MipMapUri (photo);

            try {
                return new MipMapFile (mipmap_uri);
            } catch {}

            GenerateMipMap (photo);

            return new MipMapFile (mipmap_uri);
        }
开发者ID:rubenv,项目名称:tripod,代码行数:12,代码来源:MipMapGenerator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IPicoContainer类代码示例发布时间:2022-05-24
下一篇:
C# IPersonRepository类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap