PNG transparency problem
Markus Friedl
friedl_markus at hotmail.com
Thu May 23 12:12:23 EDT 2002
Hi...
I have a little problem with using PNG images and hope anybody could help
me...
I need to use a PNGs alpha channel but it actually behaves a bit strange...
here is what I do...
- setting up video mode like this:
if pygame.display.mode_ok(1024, 768, pygame.FULLSCREEN, 32):
common.mainScreen = pygame.display.set_mode(1024, 768,
pygame.FULLSCREEN, 32)
else:
sys.exit()
- I then load a png image and create a surface:
lightSurface = pygame.image.load(os.path.join("resources", "images",
"lights.png")).convert()
- then I blit
mainSurface.blit(lightSurface, (0,0))
- and update
pygame.display.update()
the problem is if I use "convert()" for better performance when loading the
PNG I lose the alpha information and get a surface with a white background.
If I do not use "convert()" it works....
well seems like the video mode is not compatible to the image format...
Any ideas????
THANKS already in advance!
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
More information about the Python-list
mailing list