PIl, text and Windows 2000

Ben b.e.n. at .r.e.h.a.m.e...c.o.m
Mon May 21 09:23:24 CEST 2001


Platform: Windows 2000
Python Version: 2.0 (PyWin)
PIL Version: Latest

Hi,
I am currently having a particularly hard time getting some text down
onto a 2 bit png file using PIL and i was wondering 
if anyone has been successful in doing this could you please provide
me with some pointers or sample code.

Here is a piece of test code I have written which doesn't throw a
traceback error &  doesn't modify the image it is intended to.

Thanks



# Write Some Text On A 2 Bit png File With A White Background

import os, Image, ImageDraw, ImageFont, _imagingft


FontType = ImageFont.load('c:\\Python20\\PIL\\pilfonts\\courB10.pil')

ImageEdit = Image.open('c:\\Test2\\Test.png')

addtext = ImageDraw.Draw(ImageEdit)

addtext.text((20,20), 'Here is some text',128, FontType,None)





More information about the Python-list mailing list