Re: [PyOpenGL-Users] Help: glReadPixels error on OS X
Brought to you by:
mcfletch
From: Ian M. <ia...@ge...> - 2013-05-23 14:16:09
|
On Wed, May 22, 2013 at 6:38 PM, Hugo H <he...@gm...> wrote: > Hello all, > > I am facing an issue with using glReadPixels returning a <c_byte_Array> > object instead of the expected string. > > Is this a bug ? Any idea how to get the pixel's value ? > > Thank you in advance ! > Greetz, > > Hugo > Instead of: pixel = ord(pixel[0]), ord(pixel[1]), ord(pixel[2]) Try this: pixel = pixel[0][0][0],pixel[1][0][0],pixel[2][0][0] Python 3 handles strings much differently from Python 2. I suspect PyOpenGL was changed, intentionally, to make this string functionality consistent across Python versions. Ian |