pygame on win32, image.fromstring()

Greg Krohn greg at invalid.invalid
Sat May 14 03:41:20 EDT 2005


tlviewer wrote:
> hello,

hi

> fp = open( "e:/batch/python/aceclub.bmp", "wt")

wt? Should this be wb?

> # gives: ValueError: String length does not equal format and resolution size
> img = gm.image.fromstring(str,(71,96),"P")

The pygame docs say "P" is for 8bit pallete indices. When I look at the
properties of aceclub.bmp, Windows says it's Bit Depth is 4. I'm not sure if
they're talking about the same thing, though. If so, you could probably use PIL
to convert the depth.

-greg



More information about the Python-list mailing list