Using Foreground Image
Join the DZone community and get the full member experience.
Join For FreeYou 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.
Opinions expressed by DZone contributors are their own.
Comments