Re: Screen Resolution



Sandy K wrote:
When i add an image in a window, it is displayed
properly  only in some screen resolution. I have a
screen resolution of 1024 * 768. The window is
displayed properly in this resolution. But when the
resolution is changed to either 800*600 or 640*480,
then the window screen goes out of boundary.

I don't know how you load this image? In most cases, if
you not explicitly resize the image (e.g. if you add the image
with glade) the image widget (GtkImage) is as big as the
image. If you load a 1024x768 image with a screen resolution
of 800x600 it won't fit.

Is there any way by which i can control this, so that
the window is always displayed within the boundary for
all the screen resolution?

Sure, you just have to resize the image. You can use on of

gdk_pixbuf_new_from_file_at_size
gdk_pixbuf_new_from_file_at_scale
gdk_pixbuf_scale_simple

I suggest you use the dimensions read from widget->allocation
before the image is loaded. If you use glade you should not
assign an image within glade but load it later by hand.


Cheers,
Andy



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