[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] what does pygame.image.load do?
pgyame.image.load and pygame.image.tostring are documented here:
http://www.pygame.org/docs/ref/image.html
Briefly, load reads a file or Python file like object and returns a Pygame
surface formatted to the content of the file. tostring returns a surface's
image as a Python string of pixel data.
Pygame surfaces can be used without having to initialize Pygame or open a game
window. But you do need Pygame and SDL. At a minimum you probably need these
modules in the pygame package (for Windows): base.pyd, surface.pyd, image.pyd
and image_ext.pyd. The shared libraries SDL.dll, SDL_image.dll, zlib1.dll,
libpng13.dll, jpeg.dll and libtiff.dll are also required.
An alternate image package is the Python Image Library (PIL).
http://www.pythonware.com/products/pil/
Lenard
Quoting Astan Chee <stanc@xxxxxxxxx>:
>
> Hi,
> I was just wondering what does the function pygame.image.load and
> pygame.image.tostring do? What arguments do they take? What do they return?
> Also was wondering if I didnt have pygame and didnt want to use pygame
> (no offense) but I want to use these two functions how would I do it?
> What other modules do I need? I tried google abit but mostly the stuff
> there no longer exists.