[Gtk-sharp-list] Issue concerning button image

dkarantonis dkarantonis at soft4real.com
Mon Jan 11 04:14:08 EST 2010

dkarantonis wrote:
> Hi to all,
> i am using the following code in order to set a custom image on top of a
> Gtk Button widget in order to be used for a touch-screen application.
> Gdk.Pixbuf pixBuf = new Gdk.Pixbuf(byte[]);
> pixBuf = pixBuf.ScaleSimple(btn.WidthRequest, btn.HeightRequest,
> Gdk.InterpType.Nearest);
> btn.Image = new Image(pixBuf);
> the button is of 'Text and image" type, but i clear the text propery in
> order for the image to be displayed alone. The image is fetched from a
> byte[] inside my application and I would like to cover the whole button
> area, this is the reason for scaling it to the button width and height
> properties.
> Everything should work as expected but the result is not perfect. The
> image cannot cover the whole button area. A top-left offset is displayed
> instead, leaving part of the button control surface uncovered.
> Any ideas on how to set the image cover the whole button area? 
> thanks in advance and i wish you all a happy and creative new year!!!

Hi again,
any ideas concerning the issue mentioned here?


View this message in context: http://old.nabble.com/Issue-concerning-button-image-tp26977415p27107604.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.

More information about the Gtk-sharp-list mailing list