piece bitmaps - how to get a transparent background
Posted:
23 May 2011, 20:23
by gmseed
Hi
I downloaded the xboard source code and was intending to use the bitmaps in the winboard directory.
However, I notice that they are on a white background and wonder how they are used in xboard so that the white background is not shown.
Thanks.
Graham
Re: piece bitmaps - how to get a transparent background
Posted:
23 May 2011, 22:06
by H.G.Muller
The WinBoard bitmaps (*.bmp files) are monochrome bitmaps. The routines in WinBoard that render a piece use the set bits in them (those that display as black when you view the bitmap with, say, MS Paint) to either clear an area of the complete board bitmap that is being drawn, or set it to given color. For the white (outline) pieces this requires two bitmaps: one (the *w.bmp) for setting the white background, the other (*o.bmp) for drawing the black outline over it. The black pieces need only a single bitmap (*s.bmp), as their small 'internals' are transparent.
When I wanted to use them for my viewer webpage, I loaded the *o.bmp and *s.bmp bitmaps in another drawing program (IrfanView), floodfilled the exterior with another color, designated that color as transparent, and then saved them as 16-color gif files.
Re: piece bitmaps - how to get a transparent background
Posted:
24 May 2011, 19:49
by gmseed
Hi
Thanks, that's very helpful.
Graham