You Are Here:

Community: Developer Discussion Boards

#1 Old Question How to print on a white canvas? - 2007-11-08, 18:26

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Hi,
I'd like to know how to show text on a white background (canvas). For example, I set the canvas

import appuifw, e32
import graphics

def redraw(rect):
canvas.clear(0xffffff)

canvas = appuifw.Canvas(redraw_callback=redraw)
appuifw.app.body = canvas
appuifw.app.screen = 'full'
e32.ao_sleep(20)
e32.reset_inactivity()

and I want to display a message on the white background. What function do I use and where do I put it?
Thank you.
Reply With Quote

#2 Old Re: How to print on a white canvas? - 2007-11-08, 19:05

Join Date: Oct 2007
Posts: 67
nlsp
Offline
Regular Contributor
You can use the canvas.text((left, top), message) method after canvas.clear(0xffffff)

where left and top are coordinates like (0, 12) and message is a unicode string
Reply With Quote

#3 Old Re: How to print on a white canvas? - 2007-11-08, 19:17

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Quote:
Originally Posted by nlsp View Post
You can use the canvas.text((left, top), message) method after canvas.clear(0xffffff)

where left and top are coordinates like (0, 12) and message is a unicode string
Thanks. Seems to work.
Reply With Quote

#4 Old Re: How to print on a white canvas? - 2007-11-08, 20:25

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi bogdan.galiceanu,

You can check this working example, it could help you: http://wiki.forum.nokia.com/index.ph...mage_on_canvas

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#5 Old Re: How to print on a white canvas? - 2007-11-09, 05:42

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Quote:
Originally Posted by lfd View Post
Hi bogdan.galiceanu,

You can check this working example, it could help you: http://wiki.forum.nokia.com/index.ph...mage_on_canvas

LFD
Thank you LFD, that's some interesting stuff. I'll try to implement it and see how it goes.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Python for UIQ cassioli Python 141 2008-06-11 19:16
How to send an image with attachment in email krtrivdi Python 1 2007-01-09 13:07
Sending an image over email jeclarim Python 3 2006-12-15 21:25
Series 40 White Border on Full Canvas ian@silicon-magic.co.uk Mobile Java General 0 2006-06-20 10:58
Major problem with delegation to Canvas bartekn Mobile Java Media (Graphics & Sounds) 8 2003-10-08 18:46

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia