RE: create xpm: transparent color
| From: | Andrei Zmievski | Date: | Mon, 02 Aug 2004 04:09:45 +0000 |
| Subject: | RE: create xpm: transparent color | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1044@lists.php.net to get a copy of this message | ||
Guys,
> No, that doesn't work. (No idea whether that's a GTK or PHP-GTK thing.)
> Just use 'none' in the pixmap array.
>
> "32 32 7 1",
> " c none",
> ". c #005F00", "+ c #008A00", "@ c #00BB00",
> "# c #00E000", "$ c #00F709", "% c #4BE24A",
>
> BTW is it possible to bring the size of the pixmap array in
> shape_combine_mask to anywhere it might fit onto a laptop screen?
You are misunderstanding what the "transparent color" parameter is
supposed to mean. You think it will specify the color that is supposed
to be transparent in the pixmap, but that's not true. The transparency
in the pixmap is specified by 'none'. What this parameter actually means
is what color the transparent ('none') pixels will be if you load it and
do not use the mask. For example, use 'none' like Steph suggests and
replace the relevant portion of your code with this:
$clTransparentTest = &new GdkColor('#0000ff');
$arPxTest = Gdk::pixmap_create_from_xpm_d($window->window, $clTransparentTest,
$arXPMs['ok']);
$btnTest = &new GtkButton();
$pxmTest = &new GtkPixmap( $arPxTest[0], null);
You will see that the areas that are supposed to be transparent in the
source xpm are actually colored with blue color now.
HTH,
-Andrei
* We reason deeply, when we forcibly feel. *