How do I draw multiple GdkPixmap in a drawable?



Hi,all:
  thanks for havoc and Alexander's advice.I want to expound my whole process.My app's aim is these below:

1) First,creating a window include drawing_area.Then,using gdk_pixmap_new() function to create a pixmap,I 
named it pixmap1. Its size is equal to size of drawing_area,and I set its background color to white.
2) Loading a image from a image file,I use imlib function ,so I may load many format file include jpg,xpm,bpm 
etc.a piece of code is following:
       
    GdkPixmap             *pixmap2,*mask;
    GdkImlibImage         *im;
    gint width,height
    
    im=gdk_imlib_load_image(filename);
    gdk_imlib_render(im,width,height);
    pixmap2=gdk_imlib_move_image(im); 
    mask=gdk_imlib_move_mask(im);
    if (mask) gdk_window_shape_combine_mask(drawing_area->window,mask,0,0);
    gdk_draw_pixmap(pixmap1,gc,pixmap2,0,0,0,0,width,height);

  I draw pixmap2 on pixmap1.The Pixmap2 's size is often 800x600 or 640x480.Showing pixmap2 is normal.

3) When I press mouse button,I invoke a my function ---showpointer().It draw a small pixmap on where I press 
button so that catch  somebody's eyes.
   
   pixmap3=gdk_pixmap_create_from_xpm_d(drawing_area->window,  &mask,&color,(gchar **)pointer); 
   gdk_draw_pixmap(pixmap1,gc,pixmap3,0,0,current_x,current_y,48,48); 

I may draw pixmap3,but its background color is white.While puting it on pixmap2 ,it hide pixmap2.I want to 
make it transparent,Only showing image,get ride of background color.

 When I invoke  mask=gdk_imlib_move_mask(im) ,I check mask and found it is NULL.

How should I do? Please give some material or example to me .Thanks for any advices.


Rings   
         





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