Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from appuifw import*
- from graphics import*
- from e32 import*
- from fgimage import*
- from time import*
- from appswitch import*
- class jam:
- def __init__(self):
- self.run = 1
- self.gb = Image.open(u'e:\\num.png')
- self.im = Image.new((self.gb.size))
- self.step = 35
- self.xx = 66
- self.yy = 99
- self.A = 0
- self.rec = {}
- self.fg = FGImage()
- app.exit_key_handler = self.exit
- self.ss = screenshot()
- switch_to_fg(u'Layar Awal')
- def exit(self):
- self.run = 0
- self.fg.unset()
- def tomask(self,img):
- msk = Image.new(self.gb.size,'L')
- msk.blit(self.img)
- return msk
- for i in range(10):
- x = ((i*self.step+self.A))
- self.rec[i] = (x,0,x+self.step-1,self.gb.size[1])
- self.A += 1
- def digital(self):
- while self.run:
- if application_list(1)[0] in [u'Layar Awal']:
- self.im.clear(0)
- self.im.blit(self.ss,source=(self.xx,self.yy))
- tm = unicode(strftime('%H %M'))
- for j in range(len(tm)):
- try:
- self.im.blit(self.gb,self.rec[int(tm[j])],mask = self.tomask(self.gb),target=(0+self.step*j,0))
- except:
- pass
- self.fg.set(self.xx,self.yy,self.im._bitmapapi())
- else:
- self.im.clear(0)
- self.fg.unset()
- ao_sleep(0)
- tes = jam()
- tes.digital()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement