简体   繁体   中英

How do I continue writing text in PIL from where I left off the last line

So this is not about multilining. I just wanna write one text and then write another text from where the last one ended, ie one line below from that. For example, I have 2 strings say Quote = "blah blah blah" Author = "-blah" And I wanna draw the text on an image so that I can put the author just in the next line from where the quote ended. Assume the quote is multilined

PIL modules PIL.ImageDraw.Draw.text method will do it, go through the this link

 PIL.ImageDraw.Draw.text(xy, text, fill=None, font=None, anchor=None)

xy is Top left corner of the text. You can do something like this

PIL.ImageDraw.Draw.text((227,160),text_to_add,(0,0,0),font=font)

(227,160) are the x,y co-ordinates and (0,0,0) is the color of the text in rgb.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM