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

Re: [pygame] Per Pixel Alpha



Brian Fisher wrote:
Hi Ian,
The problem is that your SRCALPHA flag wasn't respected. I think this is a bug that has been fixed in svn/1.8 (although I'm not 100% sure, I'll check). The simplest workaround is probably to specify a 32 bit depth, like this:

PerPixelSurface = pygame.Surface((180,180),SRCALPHA, 32)

sadly, there were a number of small bugs with getting surface settings right - checking the values of get_flags() and get_bitsize() help make sure pygame respected the code you wrote.

On Feb 8, 2008 9:38 AM, Ian Mallett <geometrian@xxxxxxxxx <mailto:geometrian@xxxxxxxxx>> wrote:

    Here you go!


It is a commonly held misconception that any surface created with a SRCALPHA automatically has 32 bit pixels. This is wrong. The pixels size defaults to that of the display. To ensure per-pixel alpha always provide the pixel size argument. I have had to patch several packages because of this oversight.

--
Lenard Lindstrom
<len-l@xxxxxxxxx>