Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Using foreground image (See related posts)

You can draw directly to the phone screen.
It is useful for a notification from a background program.
You need to install fgimage.pyd from here.
import fgimage, e32

img = Image.new((100, 16))  # create a notification text
img.text((0, 14), u'Hello world', 0)

fg = fgimage.FGImage()
x, y = 0, 40           # position to draw
fg.set(x, y, img._bitmapapi())  # send it

e32.ao_sleep(1)
fg.unset()                # then clear it


See (a bit) more discussion here.

You need to create an account or log in to post comments to this site.


Click here to browse all 4861 code snippets

Related Posts