RE: How to get GtkImage resize of widget container?




Hi,

I have do this in size-request event of the GtkViewport?, Does it works if the user maximize the window?

Thanks.


No, GtkImage doesn't resize the pixbuf automatically for you. You will have to do it manually whenever you 
get a resize event. Thus you will need to store your original image in an off screen GdkPixbuf, and on an 
resize event create a resized copy through gdk_pixbuf_scale_simple() that you then provide to the GtkImage. 
Don't forget to unref the rescaled pixbuf after you pass it to GtkImage so you won't get a memory leak.


Hope this helps.

Regards,
Dov





Hi,



I have a GtkImage inside GtkViewport.



I want that GTKImage resize with the width/height of the widget container.

I try to use gtk_widget_size_request method of the widget but it hasn't the

actually width.



Anyway to get GtkImage automatically fit width/heigth to adjust to widget container?





_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx


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