Method

GdkPixbufPixbufadd_alpha

Declaration [src]

GdkPixbuf*
gdk_pixbuf_add_alpha (
  const GdkPixbuf* pixbuf,
  gboolean substitute_color,
  guchar r,
  guchar g,
  guchar b
)

Description [src]

Takes an existing pixbuf and adds an alpha channel to it.

If the existing pixbuf already had an alpha channel, the channel values are copied from the original; otherwise, the alpha channel is initialized to 255 (full opacity).

If substitute_color is TRUE, then the color specified by the (r, g, b) arguments will be assigned zero opacity. That is, if you pass (255, 255, 255) for the substitute color, all white pixels will become fully transparent.

If substitute_color is FALSE, then the (r, g, b) arguments will be ignored.

Parameters

substitute_color

Type: gboolean

Whether to set a color to zero opacity.

r

Type: guchar

Red value to substitute.

g

Type: guchar

Green value to substitute.

b

Type: guchar

Blue value to substitute.

Return value

Type: GdkPixbuf

A newly-created pixbuf.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The return value can be NULL.