本文整理汇总了C#中IPhoto类的典型用法代码示例。如果您正苦于以下问题:C# IPhoto类的具体用法?C# IPhoto怎么用?C# IPhoto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPhoto类属于命名空间,在下文中一共展示了IPhoto类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例5: BrowsablePointerChangedEventArgs
public BrowsablePointerChangedEventArgs(IPhoto previous_item, int previous_index, IBrowsableItemChanges changes)
: base()
{
PreviousItem = previous_item;
PreviousIndex = previous_index;
Changes = changes;
}
示例6: ProductsController
public ProductsController(INews news, IModule module, IPhoto photo, ICacheManager cache)
{
_news = news;
_module = module;
_cache = cache;
_photo = photo;
}
示例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);
}
}
}
示例8: PrintOperation
public PrintOperation(IPhoto [] selected_photos)
{
this.selected_photos = selected_photos;
CustomTabLabel = Catalog.GetString ("Image Settings");
NPages = selected_photos.Length;
DefaultPageSetup = Global.PageSetup;
}
示例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;
}
示例10: Load
public static Gdk.Pixbuf Load(IPhoto item)
{
using (var img = ImageFile.Create (item.DefaultVersion.Uri)) {
Gdk.Pixbuf pixbuf = img.Load ();
return pixbuf;
}
}
示例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);
}
}
示例12: Photo
public Photo(IPhoto photo)
{
PhotoId = photo.PhotoId;
PhotoName = photo.PhotoName;
PhotoType = photo.PhotoType;
PhotoPath = photo.PhotoPath;
GalleryId = photo.GalleryId;
}
示例13: InvalidateThumbnail
public void InvalidateThumbnail (IPhoto photo)
{
PhotoGridViewChild child = GetDrawingChild (photo);
if (child != null) {
child.InvalidateThumbnail ();
View.QueueDraw ();
}
}
示例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);
}
示例15: GetDrawingChild
protected PhotoGridViewChild GetDrawingChild (IPhoto photo)
{
foreach (PhotoGridViewChild child in Children) {
if (child != null && child.BoundPhoto == photo) {
return child;
}
}
return null;
}