re pixmaps masks icons clues in article sophia inria fr lehors koala inria fr arnaud le hors writes in article buzz mar lion bear com buzz bear com buzz moschetti writes this is a simple x graphics question assume you have a valid window w an icon pixmap and the background mask also a pixmap for that icon you wish to place the icon at x y in w without the background question what combination of xcopyarea and gc functions are necessary i think the idea is to merge only those pixels of pixmap into w as indicated by the corresponding mask pixel value specifically the problem involves a pixmap and mask generated by the xpm libs any clues would be most appreciated xpm provides you with symbolic color names which can be specified at load time so for doing what you want i would suggest you to define a background symbol in your pixmap file which you ll set to whatever color is used by the widget or the window on which you want to put your pixmap this would surely be the simplest and fastest way to do what you want no as soon as you blit two of this icons once on top of the other with a little dislocation you see the rectangular blit crashes too much of the icon first blitted because it draws a full rectangle the way to do it is masking create a bitmap with all pixels to be merged are and all not to be merged are then set the clip mask of the gc to this bitmap set the clip x origin and clip y origin of the gc to the x y coordinates where you blit the icon to the destination drawable use gxcopy and xcopyarea the icon pixmap to the destination drawable using this gc o o o brain inside o o o o andre beck abpsoft mehl andre beck irs inf tu dresden de o o o
