On Tue, 2002-05-07 at 12:09, Fionn Behrens wrote: > On 06 May 2002 14:59:55 -0400 > Steve McClure <[EMAIL PROTECTED]> wrote: > > > On Mon, 2002-05-06 at 14:46, Steve McClure wrote: > > > > Sorry for the interruption, I found the answer. > > .... then why dont you post it? ;-)
Be glad to. The pixmapMaskList is a list of pixmap and mask tuples
created with create_pixmap_from_xpm. I assume the list contains at least
one pair. I also assume that the list is ordered from bottom to top.
def buildPixmap(pixmapMaskList):
basepm, basemask = pixmapMaskList[0]
# don't bother compositing if just one pixmap.
if len(pixmapMaskList) == 1:
return basepm, basemask
win = gtk.GtkWindow()
newpm = gtk.create_pixmap(win, basepm.width, basepm.height,
basepm.depth)
tempgc = basepm.new_gc(clip_mask=basemask, clip_x_origin=0,
clip_y_origin=0)
gtk.draw_pixmap(newpm, tempgc, basepm, 0, 0, 0, 0, basepm.width,
basepm.height)
gc = newpm.new_gc()
i = 1
while i < len(pixmapMaskList):
pm, mask = pixmapMaskList[i]
# create a new gc using this pixmaps mask, for now assume the origin
# of all the pixmaps is the same
tempgc = newpm.new_gc(clip_mask=mask, clip_x_origin=0,
clip_y_origin=0)
# and draw into the base pixmap.
gtk.draw_pixmap(newpm, tempgc, pm, 0, 0, 0, 0, pm.width, pm.height)
# also update the base mask with the bits from this mask
tempgc = basemask.new_gc(clip_mask=mask, clip_x_origin=0,
clip_y_origin=0)
gtk.draw_pixmap(basemask, tempgc, mask, 0, 0, 0, 0, pm.width,
pm.height)
i = i + 1
return newpm, basemask
>
> Regards,
> Fionn
> --
> I believe we have been called by history to lead the world.
> G.W. Bush, 2002-03-01
> _______________________________________________
> pygtk mailing list [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
--
Steve McClure 430 10th St NW
Racemi Suite N-210
http://www.racemi.com Atlanta, GA 30318
[EMAIL PROTECTED] voice/fax: 404-892-5850
signature.asc
Description: This is a digitally signed message part
