[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Problems with surfarrays




> the good news is, you should be able to do what you want with the
> surfarray module. when you want to 'interact' with the alpha channel,
> the only way to do it is be getting an array from pixels_alpha (this
> only works for 32bit surfaces). the pixels_alpha array directly
> references the alpha values in the Surface. so changing the array
> changes the pixels.
>

>    alphaarray=pygame.surfarray.pixels_alpha(self.surface)

Well, I tried doing it this way, however any changes I make to alphaarray
don't seem to affect the picture at all. (The array again changes as
expected) Of course I only tried to draw the picture when alphaarray had
already been destroyed since the documentation mentions that it is locked
until then.
I'd really like to get this to work because it is about 10 times faster in
my case than using set/get_at (165ms vs 1640ms on a 4069*32 picture ;))



____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org