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

Re: [pygame] surfarray.pixels3d() bug?



Sorry about that, here you go:

self.TempSurf.fill((0,0,0))

pygame.draw.polygon(self.TempSurf, (0,0,20), rectangle, 0)

temp_array = pygame.surfarray.pixels3d(self.TempSurf)

pygame.surfarray.blit_array(Screen, temp_array)

If I change pixels3d to pixels2d everything's fine, but it would be easier if I could access the color values in the RGB format.
mark
On Tue, Sep 30, 2008 at 4:08 PM, Forrest Voight <voights@xxxxxxxxx> wrote:
You're probably doing something wrong. It helps a lot to post code samples. :)

On Tue, Sep 30, 2008 at 3:18 PM, Mark S <slygroups@xxxxxxxxx> wrote:
> Hi all,
>
> I am trying to use surfarray.pixels3d() to copy a surface to an array but it
> doesn't seem to be working properly.  If I call that function and then blit
> the array right back to the surface (after first clearing it) what is
> produced is a 90 degree rotation of the original image that is repeated a
> few times with a vertical offset.  Also, the array generated image is
> missing periodic vertical strips of the original image.
>
> If I do the exact same thing with surfarray.pixels2d() it works perfectly.
>
> I'm wondering if there is something wrong with the 3d function or if I'm
> actually doing something wrong.
>
> Thanks a lot,
>
> mark