preventing BG image from tiling
Hi all,
I have one gtk window and I tried to set image bg here is code code snap
Gtk::EventBox * canvas = mScreen->GetCanvas();
width = canvas->get_width();
height = canvas->get_height();
Glib::RefPtr<Gdk::Pixbuf> BgImg;
Glib::RefPtr<Gdk::Pixmap> OffScrnImg;
Glib::RefPtr<Gdk::Bitmap> Mask;
Glib::RefPtr<Gtk::Style> styleset;
BgImg = Gdk::Pixbuf::create_from_file(LOGO, width, height, TRUE);
BgImg->render_pixmap_and_mask (OffScrnImg,Mask,0);
styleset = Gtk::Style::create();
styleset->set_bg_pixmap (Gtk::STATE_NORMAL,OffScrnImg);
canvas->set_style (styleset);
Now the problem is when I run the pgm image will be shown on left and right side of the window and when I maximise the window, bg image will get tiling effect, so image will shown 4 side i.e.top, bottom, left & right. Can anyone knows what might be the reason and what could be done.
|