Re: Images in GTKmm



I would do this with a DrawingArea. It is possible to resize a Pixbuf to the size of the DrawingArea and render it in a callback plugged to the expose_event signal.

But I don't known if it is the best way! ;)
yann

On 02/08/11 12:51, Thomas Harty wrote:
I want to put an image into a box in such a way that the image will
shrink to fit into empty space in the box, whilst preserving its aspect
ratio. Thus, the dimensions of the image should be determined by the
dimensions of the objects around it. The image needs to shrink and
expand with the box (e.g. if the user re-sizes the main window).

For example, I want to put a few items in a VBox and have these items
determine the width of the VBox. I then want to be able to add the image
to the VBox in such a way that it doesn't resize the box, but rather
fits into the space. If there is space left above/below the widget (due
to the constraint of preserving it's aspect ratio), this should be
filled with padding, rather than the image expanding to fill the space.

What's the best way of accomplishing this in Gtkmm?

Tom



_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]