[spambayes-dev] button ideas (oh boy)

Kenny Pitt kennypitt at hotmail.com
Wed Oct 6 16:12:56 CEST 2004

Tony Meyer wrote:
> ... Can't we just mark the pixels around
> the smiley face as transparent?

I've done this before in C++, and unfortunately Microsoft made it a bit
complicated.  It involves creating two separate images: the original and a
two-color mask version that defines which pixels are transparent and which
aren't.  You then have to register two special clipboard formats and copy
both images to the clipboard using the appropriate formats.

I took a look at doing this in Python a while back.  After looking through
the pywin32 source code for the clipboard handling several times, I was
unable to figure out any way to get the bitmaps onto the clipboard in the
required format.  I think we would need some enhancements to pywin32 to be
able to do this directly from Python.

If I had the time, I could probably put together a custom .pyd extension
library specifically for the purpose of handling the toolbar images.  I have
all the C++ code for creating the mask image and putting everything on the
clipboard.  I would just need to work out the Python integration bits, which
is something I've never worked on before.  The question is, do we think that
effort would be worthwhile?  If so, how would we incorporate the .pyd into
our development process so that people can still run easily from source?

Kenny Pitt

More information about the spambayes-dev mailing list