裁剪坟墓
def cropimg(image, region):
from cStringIO import StringIO
img = Image.open(image)
# region = (64, 0, 192, 95)
cropImg = img.crop(region)
imgBuf = StringIO(cropImg.tobytes())
imgx = pygame.image.frombuffer(imgBuf.getvalue(), (region[2] - region[0], region[3] - region[1]), "RGBA")
return imgx
img = r'resources/images/map.png'
region = (161, 95, 193, 129)
imgx = cropimg(img, region)
screen.blit(imgx, (200,200))
/**
*
* __ (__`\
* (__`\ \\`\
* `\\`\ \\ \
* `\\`\ \\ \
* `\\`\#\\ \#
* \_ ##\_ |##
* (___)(___)##
* (0) (0)`\##
* |~ ~ , \##
* | | \##
* | /\ \## __..---'''''-.._.._
* | | \ `\## _.--' _ `.
* Y | \ `##' \`\ \
* / | \ | `\ \
* /_...___| \ | `\\
* / `. | / ##
* | | | / ####
* | | | / ####
* | () () | \ | | _.-' ##
* `. .' `._. |______..| |-'|
* `------' | | | | | || |
* | | | | | || |
* | | | | | || |
* | | | | | || |
* _____ | | | |____| || |
* / `` |-`/ ` |` |
* \________\__\_______\__\
* """"""""" """""""'"""
* Don't be a fucking stupid donkey! No, this is a fucking mule!
*/