Advertisement
iful99

jamdigital

Jul 27th, 2015
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. from appuifw import*
  3. from graphics import*
  4. from e32 import*
  5. from fgimage import*
  6. from time import*
  7. from appswitch import*
  8.  
  9. class jam:
  10.  def __init__(self):
  11.   self.run = 1
  12.   self.gb = Image.open(u'e:\\num.png')
  13.   self.im = Image.new((self.gb.size))
  14.   self.step = 35
  15.   self.xx = 66
  16.   self.yy = 99
  17.   self.A = 0
  18.   self.rec = {}
  19.   self.fg = FGImage()
  20.   app.exit_key_handler = self.exit
  21.   self.ss = screenshot()
  22.   switch_to_fg(u'Layar Awal')
  23.  
  24.  def exit(self):
  25.   self.run = 0
  26.   self.fg.unset()
  27.  
  28.  def tomask(self,img):
  29.   msk = Image.new(self.gb.size,'L')
  30.   msk.blit(self.img)
  31.   return msk
  32.   for i in range(10):
  33.     x = ((i*self.step+self.A))
  34.     self.rec[i] = (x,0,x+self.step-1,self.gb.size[1])
  35.     self.A += 1
  36.  
  37.  
  38.  def digital(self):
  39.   while self.run:
  40.    if application_list(1)[0] in [u'Layar Awal']:
  41.     self.im.clear(0)
  42.     self.im.blit(self.ss,source=(self.xx,self.yy))
  43.     tm = unicode(strftime('%H %M'))
  44.     for j in range(len(tm)):
  45.      try:
  46.       self.im.blit(self.gb,self.rec[int(tm[j])],mask = self.tomask(self.gb),target=(0+self.step*j,0))
  47.      except:
  48.       pass
  49.     self.fg.set(self.xx,self.yy,self.im._bitmapapi())
  50.    else:
  51.     self.im.clear(0)
  52.     self.fg.unset()
  53.    ao_sleep(0)
  54.  
  55. tes = jam()
  56. tes.digital()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement