Re: Image/Pixbuf: How to set colour "behind" (semi)-transparent data?



Ole Laursen wrote:

Toralf Lund <toralf procaptura com> writes:

When drawing a pixbuf which has an alpha channel, how do I set the
background colour? I'm talking about the colour that will "shine
through" fully or partially where alpha value<255. (Seems like a
grayish colour is the default; I actually want black instead.)

Hm, I think I've done this with both Hardware Monitor and Monster
Masher (source available from my home page). IIRC, there is a
modify_bg() method inherited from Gtk::Widget.

Yes, this actually turned out to work. I tried this method before asking, of course, but what confused me at first was that it's not the background of the image itself that will be visible through the transparent pixels, but the one of the object that contains the image. In other words, I essentially had to call

   image->get_parent()->modify_bg(...)

not just image->modify_bg(...)

- Toralf




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