Setting alpha transparency for an image
- From: "Germán Diago" <germandiago gmail com>
- To: gtkmm-list gnome org
- Subject: Setting alpha transparency for an image
- Date: Wed, 13 Aug 2008 19:30:42 +0200
I want to set the alpha transparency of an image with this code, but
it does nothing.
Could anyone tell me the correct way to do it?
bool on_expose_event(GdkEventExpose* ev)
{
img_->add_alpha(false, 0, 0, 0);
img_->composite(img_, 0, 0, img_->get_width(), img_->get_height()
, 0, 0, 1, 1, Gdk::INTERP_BILINEAR, 10);
img_->render_to_drawable(get_window(), get_style()->get_black_gc(),
0, 0, 100, 80, img_->get_width(), img_->get_height(), // draw the
whole image (from 0,0 to the full width,height) at 100,80 in the
window
Gdk::RGB_DITHER_NONE, 0, 0);
return true;
}
img_ is a Glib::RefPtr<Gdk::Pixbuf>.
Thanks in advance.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]