Exemplo n.º 1
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);
                }
            }
        }
Exemplo n.º 2
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();
     }
 }