Archived:How to add a text to an image in PySymbian

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

Acredita-se que este artigo ainda seja válido no contexto original (quando ele foi escrito)

This article contains code snippets showing how text can be added to an image or a photo in PySymbian.

Article Metadata
Tested with
Devices(s): Nokia N96
Platform(s): S60 2nd Edition, S60 3rd Edition
Platform Security
Capabilities: )
Keywords: graphics, image
Created: User:Kandyfloss (28 Apr 2008)
Last edited: hamishwillee (31 May 2013)



How to add text to a blank image

# import module
from graphics import *
# Open new blank Image of given size
# Write text at given position
bg.text((30,30), u"Text", font="title")
# Save the new Image
bg.save("C:\\TextOnImage.jpg", quality=100)

How to add text to a photo

# import module
from graphics import *
# Open an existing Image
# Write text at given position
photo.text((100,80), u"Green Circle", font="normal")
# Save the new Image


We obtain following resulting images from above code

Text on a Blank Image
Text on existing photo of a Green Circle

Related Links

How to edit an image

This page was last modified on 31 May 2013, at 01:08.
48 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.