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

Re: [pygame] Pasting of images



If you want to copy the small surface with alpha values,you should disable alpha before blitting, or it's just blitting, not pasting.

On 1/23/07, mva@xxxxxxxxxxxx <mva@xxxxxxxxxxxx> wrote:
Qasim Askari <cassim@xxxxxxxx>:

> Dear All:
>
> I am stuck in a problem and hope that someone can help me getting over it.
>
> I have two images. I want one image which is of smaller size to be pasted on
> top of the other image. Can anyone help me with a code how to achieve that
> either with pygame or python image library.

Minimum:

bigsurface = pygame.image.load ("bigimage.png")
smallsurface = pygame.image.load ("smallimage.png")
bigsurface.blit (smallsurface, (posx, posy))

Add convert() calls and anything else as necessary. posx and posy denote the
topleft offset
to use for blitting the smallsurface.

Regards
Marcus





--
<a href="" href="http://www.flyaflya.com">http://www.flyaflya.com" >flyaflya games</a> powered by pygame+python