Domanda

I'm just getting started with Mono programming using GTK, and have been pleasantly surprised. However, I have come across a hurdle I haven't been able to get over yet.

In the app I'm working on, I am able to load a JPEG image into a Pixmap and draw it to my GUI's Drawing Area. That works fine. However, I want to be able to take a second JPEG image, make it partially transparent, and draw it over the first. So far, I haven't been able to figure out a decent way to do this.

Is it somehow possible to change the alpha value of an entire Pixmap before I draw it? I'm not sure where to go from here.

È stato utile?

Soluzione

If you're using GtkDrawingArea you should be using Cairo to do the drawing itself. As an alternative to using cairo_paint() there is a cairo_paint_with_alpha() which lets you specify the opacity you wish to paint with.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top