TagIconFromPixbuf() 공개 정적인 메소드

public static TagIconFromPixbuf ( Pixbuf source ) : Pixbuf
source Pixbuf
리턴 Pixbuf
예제 #1
0
        void HandleSelectionChanged(object sender, EventArgs e)
        {
            int x      = image_view.Selection.X;
            int y      = image_view.Selection.Y;
            int width  = image_view.Selection.Width;
            int height = image_view.Selection.Height;

            if (image_view.Pixbuf != null)
            {
                if (image_view.Selection != Gdk.Rectangle.Zero)
                {
                    using (var tmp = new Gdk.Pixbuf(image_view.Pixbuf, x, y, width, height)) {
                        Gdk.Pixbuf transformed = FSpot.Utils.PixbufUtils.TransformOrientation(tmp, image_view.PixbufOrientation);
                        PreviewPixbuf = PixbufUtils.TagIconFromPixbuf(transformed);
                        transformed.Dispose();
                    }
                }
                else
                {
                    Gdk.Pixbuf transformed = FSpot.Utils.PixbufUtils.TransformOrientation(image_view.Pixbuf, image_view.PixbufOrientation);
                    PreviewPixbuf = PixbufUtils.TagIconFromPixbuf(transformed);
                    transformed.Dispose();
                }
            }
        }
예제 #2
0
        private void HandleSelectionChanged()
        {
            int x, y, width, height;

            Gdk.Pixbuf tmp = null;

            image_view.GetSelection(out x, out y, out width, out height);
//			if (width > 0 && height > 0)
//				icon_view.Selection.Clear ();

            if (image_view.Pixbuf != null)
            {
                if (width > 0 && height > 0)
                {
                    tmp = new Gdk.Pixbuf(image_view.Pixbuf, x, y, width, height);

                    //FIXME
                    PreviewPixbuf = PixbufUtils.TagIconFromPixbuf(tmp);
                    PreviewPixbuf_WithoutProfile = PreviewPixbuf.Copy();
                    FSpot.ColorManagement.ApplyScreenProfile(PreviewPixbuf);

                    tmp.Dispose();
                }
                else
                {
                    //FIXME
                    PreviewPixbuf = PixbufUtils.TagIconFromPixbuf(image_view.Pixbuf);
                    PreviewPixbuf_WithoutProfile = PreviewPixbuf.Copy();
                    FSpot.ColorManagement.ApplyScreenProfile(PreviewPixbuf);
                }
            }
        }
예제 #3
0
        private void HandleSelectionChanged()
        {
            int x, y, width, height;

            Gdk.Pixbuf tmp = null;

            image_view.GetSelection(out x, out y, out width, out height);
            if (width > 0 && height > 0)
            {
                icon_view.Selection.Clear();
            }

            if (image_view.Pixbuf != null)
            {
                if (width > 0 && height > 0)
                {
                    tmp = new Gdk.Pixbuf(image_view.Pixbuf, x, y, width, height);

                    preview_image.Pixbuf = PixbufUtils.TagIconFromPixbuf(tmp);

                    tmp.Dispose();
                }
                else
                {
                    preview_image.Pixbuf = PixbufUtils.TagIconFromPixbuf(image_view.Pixbuf);
                }
            }
        }
예제 #4
0
 void CreateTagIconFromExternalPhoto()
 {
     try {
         using (var img = App.Instance.Container.Resolve <IImageFileFactory> ().Create(new Uri(external_photo_chooser.Uri, true))) {
             using (Gdk.Pixbuf external_image = img.Load()) {
                 PreviewPixbuf = PixbufUtils.TagIconFromPixbuf(external_image);
             }
         }
     } catch (Exception) {
         string caption = Strings.UnableToLoadImage;
         string message = string.Format(Strings.UnableToLoadPhotoAsIconForTheTag, external_photo_chooser.Uri);
         var    md      = new HigMessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Close,
                                               caption, message);
         md.Run();
         md.Destroy();
     }
 }
예제 #5
0
 void CreateTagIconFromExternalPhoto()
 {
     try {
         using (var img = ImageFile.Create(new SafeUri(external_photo_chooser.Uri, true))) {
             using (Gdk.Pixbuf external_image = img.Load()) {
                 PreviewPixbuf = PixbufUtils.TagIconFromPixbuf(external_image);
             }
         }
     } catch (Exception) {
         string caption = Catalog.GetString("Unable to load image");
         string message = String.Format(Catalog.GetString("Unable to load \"{0}\" as icon for the tag"),
                                        external_photo_chooser.Uri);
         HigMessageDialog md = new HigMessageDialog(this,
                                                    DialogFlags.DestroyWithParent,
                                                    MessageType.Error,
                                                    ButtonsType.Close,
                                                    caption,
                                                    message);
         md.Run();
         md.Destroy();
     }
 }
예제 #6
0
 private void CreateTagIconFromExternalPhoto()
 {
     try {
         using (FSpot.ImageFile img = FSpot.ImageFile.Create(new Uri(external_photo_chooser.Uri))) {
             using (Gdk.Pixbuf external_image = img.Load()) {
                 PreviewPixbuf = PixbufUtils.TagIconFromPixbuf(external_image);
                 PreviewPixbuf_WithoutProfile = PreviewPixbuf.Copy();
                 FSpot.ColorManagement.ApplyScreenProfile(PreviewPixbuf);
             }
         }
     } catch (Exception) {
         string caption = Catalog.GetString("Unable to load image");
         string message = String.Format(Catalog.GetString("Unable to load \"{0}\" as icon for the tag"),
                                        external_photo_chooser.Uri.ToString());
         HigMessageDialog md = new HigMessageDialog(this.Dialog,
                                                    DialogFlags.DestroyWithParent,
                                                    MessageType.Error,
                                                    ButtonsType.Close,
                                                    caption,
                                                    message);
         md.Run();
         md.Destroy();
     }
 }