RSS/Atom feed Twitter
Site is read-only, email is disabled

Change size and ratio of Gimp Preview

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

7 of 7 messages available
Toggle history

Please log in to manage your subscriptions.

Change size and ratio of Gimp Preview Nicolás Serrano Martínez Santos 16 Apr 11:15
  Change size and ratio of Gimp Preview Torsten Neuer 16 Apr 16:44
   Change size and ratio of Gimp Preview Nicolás Serrano Martínez Santos 16 Apr 22:03
    Change size and ratio of Gimp Preview Torsten Neuer 18 Apr 09:57
     Change size and ratio of Gimp Preview Sven Neumann 18 Apr 21:12
  Change size and ratio of Gimp Preview Sven Neumann 17 Apr 23:55
   Change size and ratio of Gimp Preview Nicolás Serrano Martínez Santos 23 Apr 10:50
Nicolás Serrano Martínez Santos
2008-04-16 11:15:40 UTC (about 17 years ago)

Change size and ratio of Gimp Preview

Hi! I'm trying to develop an interface of a plugin and I would like to use a rectangular gimp preview widget. Despite I've been looking over the documentation of this class and the parents in GTK+ the widgets is always square.

In the code of gimppreview at gimp_preview_init i've find this:

if (gtk_widget_get_direction (GTK_WIDGET (preview)) == GTK_TEXT_DIR_RTL)
xalign = 1.0;

preview->frame = gtk_aspect_frame_new (NULL, xalign, 0.0, 1.0, TRUE); gtk_frame_set_shadow_type (GTK_FRAME (preview->frame), GTK_SHADOW_NONE);
gtk_box_pack_start (GTK_BOX (preview), preview->frame, TRUE, TRUE, 0);
gtk_widget_show (preview->frame);

Can I access to "preview->frame" from the plugin and change the aspect of the preview widget? Is there any way of doing this from another way?

Torsten Neuer
2008-04-16 16:44:46 UTC (about 17 years ago)

Change size and ratio of Gimp Preview

Hi,

Can I access to "preview->frame" from the plugin and change the aspect of the preview widget? Is there any way of doing this from another way?

It depends on what you are planning to do (and why).

From my point of view, I would simply use the GimpZoomPreview widget. This would adopt to the images aspect ratio and you can also see the whole image with it as well as zoom into a specific subregion.

If you just want the aspect ratio to be the same, you could look at the code for the zoom-preview widget and see how it does that trick.

Torsten

Nicolás Serrano Martínez Santos
2008-04-16 22:03:06 UTC (about 17 years ago)

Change size and ratio of Gimp Preview

Thanks for the advice. I've tried using ZoomPreview and it adjust to the drawable ratio. If i create a rectangular drawable the widget will be rectangular, what i want (let's see if i can be clear) is to adjust the width and height of the preview widget. It's adjusted to the drawable ratio and the i don't managed to change it.

Sven Neumann
2008-04-17 23:55:12 UTC (about 17 years ago)

Change size and ratio of Gimp Preview

Hi,

On Wed, 2008-04-16 at 11:15 +0200, Nicolás Serrano Martínez Santos wrote:

Hi! I'm trying to develop an interface of a plugin and I would like to use a rectangular gimp preview widget. Despite I've been looking over the documentation of this class and the parents in GTK+ the widgets is always square.

This is a design decision of the GimpPreview widget. If this doesn't fit your needs, then you can't use GimpPreview.

Sven

Torsten Neuer
2008-04-18 09:57:18 UTC (about 17 years ago)

Change size and ratio of Gimp Preview

Am Mittwoch, 16. April 2008 22:03:06 schrieb Nicol

Sven Neumann
2008-04-18 21:12:51 UTC (about 17 years ago)

Change size and ratio of Gimp Preview

Hi,

On Fri, 2008-04-18 at 09:57 +0200, Torsten Neuer wrote:

As far as I can see, the width and height of the widget can't be adjusted manually. If that is what you want, I would take GimpZoomPreview as a starting point to write a new GimpPreview class. It probably would be just a copy of GimpZoomPreview with an additional constructor that allows setting the maximum width and height of the widget (which are hardcoded into GimpZoomPreview as it is now).

Hey, this is not proprietary software. You don't need to do such terrible things. You can as well suggest changes to the widgets and submit patches.

Sven

Nicolás Serrano Martínez Santos
2008-04-23 10:50:56 UTC (about 17 years ago)

Change size and ratio of Gimp Preview

This is a design decision of the GimpPreview widget. If this doesn't fit
your needs, then you can't use GimpPreview.

In the end I used GimpPreviewArea directly (i don't see it at the documentationt at first) and if i put it inside a GtkAspectFrame i can adjust the aspect.

Thanks!!