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

Re: [pygame] Pasting of images



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