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

Re: [pygame] Simple Surfarray Alpha



I only provided that much code because I thought it was something simple.  Hmmm.  Here's my code:

#surface is loaded earlier with pygame.image.load()
surface.convert(32,SRCALPHA)
array = pygame.surfarray.pixels_alpha(surface)
array[:,:] = 255-array[:,:]
del array

It crashes with:

Traceback (most recent call last):
  File "[path]", line 152, in OnFlipAlpha
    array[:,:] = 255-array[:,:]
TypeError: Array can not be safely cast to required type

Ian