Scaling pixbuf loses alpha information



I am having a PNG picture with alpha transparency loaded with gdk_pixbuf_new_from_file.

If I resize the pixbuf using gdk_pixbuf_scale_simple (GDK_INTERP_BILINEAR) the resulting picture loses alpha information and the picture, inserted within the text view, is displayed with the black background instead of transparent one.
If I skip the resize step the picture background is correct.

I've tested this on Windows using the latest GTK 2.22.1 from gtk.org, but I noticed this on Linux too.
Good testing image (the one that reproduces the issue) can be found here:
http://upload.wikimedia.org/wikipedia/commons/thumb/2/2e/Organizational_chart.svg/500px-Organizational_chart.svg.png

Does gdk_pixbuf_scale_simple destroy the transparency ?
Can anyone recommend better way to scale the pixbuf, the one that retains the transparency ?





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