Re: transparent pixels with pixmap
- From: Taura Milana <learfox furry ao net>
- To: GTK App Devel <gtk-app-devel-list gnome org>
- Subject: Re: transparent pixels with pixmap
- Date: Tue, 19 Mar 2002 15:16:43 -0800
On 2002.03.19 14:23 Gregory Babusiaux wrote:
Hi !
I have a .xpm with some transparent pixels (made with gimp) I wish to
load in a GdkPixmap but transparent pixels are white displayed.
Here is how I try to do that :
pixmap=gdk_pixmap_colormap_create_from_xpm(NULL,
gtk_widget_get_colormap(window), &trans_mask, NULL, "/.pic.xpm");
where 'window' is correctly initialised and trans_mask copied/pasted from
a .xbm made with gimp (representing the pixels I don't want to diplay, I
changed 'static unsigned short' with 'static unsigned char' to match the
second parameter of gdk_bitmap_create_from_data() )
I tried with a GdkColor as transparent color and change the .xpm to match
the color(transparent pixel -> white), doesn't work too.
Can you give me an advice please ?
Hi Greg,
You should get a GdkPixmap and GdkBitmap when you load a .xpm
image, so instead of using a colormap and all that, try creating
a GdkGC and setting its clip mask to the GdkBitmap that was
loaded along with the GdkPixmap.
Make sure you draw the GdkPixmap and GdkBitmap at the same
location on the drawable.
--
Sincerely, ,"-_ \|/
-Capt. Taura M. , O=__ --X--
..__ ,_JNMNNEO=_ /|\
OMNOUMmnne. {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn. 'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe. "7OMMMMNNNNNWWEEEEOOOOOO" "'.
EEBNNMMMNWNWWEEIMMNe. __ 7EMMMNNNNNWWWEEEEEEEOO. " .
NNMMMMWWWMMMWEINMMMNn "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._ .
http://furry.ao.net/~learfox/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]