HELP! :(



Hi,
    I have a problem: I have in need of displaying a pixmap widget with a
transparent area... but I want to control and change the shape of this area
each time I create it. So, I have the non-trasparent pixmap in a file (png,
let's say), and the 'mask' for the alpha channel in a bicolor one. Now, how
can I assemble the two?? I've checked the header files of gdk_imlib, gdk_h,
gnome-pixmap and gtkpixmap, and it seems that GnomePixmap doesn't allow me
to do anything similar... well, I figured it could be done with imlib...
apparently, not! So I wrote something:

[...]

GtkWidget *pix;
GdkImlibImage *img,*msk;
GdkPixmap *pixmap;
GdkBitmap *bitmap;

img=gdk_imlib_load_image("a.png");
msk=gdk_imlib_load_alpha("b.png"); [or load_image, FWIW]

pixmap=gdk_imlib_move_image(img);
bitmap=gdk_imlib_move_mask(msk);

pix=gtk_pixmap_new(pixmap,bitmap);

[...]

of course, with the code relative to the app window, etc... When I compile
it, no problem, but at runtime it gives me an empty window, and says

Gtk-CRITICAL **: file gtkpixmap.c: line 97 (gtk_pixmap_new): assertion `val
!= NULL' failed

complaining of course also for gnome_app_set_contents, later on. WHY???
Please help! Is this the right approach? I could use xpm's, but they're
so... uh... uncomfortable to make and handle! Any idea? Really isn't there
an Imlib function that loads the alpha channel from a file into an existing
image? Isn't there a way to use gnome_pixmap instead of gtk_pixmap??

 Thanx so much,
  Mano :)

PS: overwhelmed by desperation, I've also written something like

[...]
pix=gnome_pixmap_new_from_imlib(img);
pix->mask=bitmap;
[...]

but it doesn't work...it says "structure has no member named `mask'"... ok,
it's a little bit stupid, maybe, but it _has_ a member named mask! it's in
the header! (oh! Why are you all laughing?? ;)






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