2006年08月07日 星期一 17:52
找到了~ try this, import Image RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) # create/read your images bg = Image.new('RGB', (800, 600), RED) img = Image.new('RGB', (400, 400), GREEN) ## paste it W, H = bg.size w, h = img.size xo, yo = (W-w)/2, (H-h)/2 bg.paste(img, (xo, yo, xo+w, yo+h)) ## voila! bg.show() you may also consider using ImageMagick (www.imagemagick.org) for this special case. hope this helps. pil应该可以 On 8/7/06, ye qiwei <yeqiwei001 at gmail.com> wrote: 将一个小图片叠加到一个大图片上,将大图片上作为背景,该怎么做? google 没有找到 _______________________________________________ python-chinese Post: send python-chinese at lists.python.cn Subscribe: send subscribe to python-chinese-request at lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -- http://www.flyaflya.com powered by pygame+python = = = = = = = = = = = = = = = = = = = = = = 致 礼! asdf -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060807/d8dd5cf8/attachment.htm
Zeuux © 2025
京ICP备05028076号