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

Re: [pygame] Displaying real time streaming images



Arthur Elsenaar wrote:
I actually want to do progressive loading, so I need to read a chuck of data from the socket, parse the data in PIL, pad the rest with 'empty' data, feed it as a StringIO object back to pygame.

Is this a correct approach to the problem?
Yes, if PIL supports the progressive loading that is going to be how you do it. I'm unfromiliar with this part of PIL, I would assume a good progressive loader would "pad" the image for you. Especially as some prograssive image formats are not linear top to bottom.

Once you have the PIL image loaded you can "tostring" it, then in Python "fromstring". These calls share compatable arguments in each library.