function ClockMaker(f, height1, width1, leftX, topY) local item = createImage(f) item.Height=height1 item.Width=width1 item.Left=leftX item.Top=topY item.Stretch = true local x0=tonumber(item.width / 2) local y0=tonumber(item.height / 2) local x10=tonumber(item.width / 2) local y10=tonumber(item.height / 2) local x20=tonumber(item.width / 2) local y20=tonumber(item.height / 2) local xx=tonumber(item.width / 2) local r = y0 - 20 local x = x0 local x1 = x10 local x2 = x20 local xx1=item.Width/6 ------------------------------------ if ix3 then ix3.destroy() ix3 = nil end local ix3 = createLabel(f) ix3.Font.Size = item.Width / 12 ix3.Font.Style = "fsBold" ix3.Font.Color = "0x00FF00" ix3.AutoSize = false ix3.Alignment= "taCenter" ix3.Height = item.Height / 8 ix3.Width = item.Width / 2 ix3.Left = item.Left + 80 ix3.Top = item.Top + item.Height - 80 local s = tonumber(os.date('%S')) local m2 = tonumber(os.date('%M')) * 60 local h2 = tonumber(os.date('%I')) * 3600 --print(h2.." - "..m2.." - "..s) local m = tonumber(os.date('%M')) local h = tonumber(os.date('%I')) ------------------------------------- function test(timer) local x,y = item.screenToClient(x,y) local bm=item.picture.Bitmap bm.Width=item.Width bm.Height=item.Height local Canvas = bm.Canvas Canvas.clear() bm.Canvas.Brush.Color="0x2000a0"; bm.Canvas.roundRect(0, 0, item.Height, item.Width, item.Height, item.Width); r = math.random(x0) y = y0 - r if r < xx then r=xx end s = s + 1 x = x0 + math.floor(r * math.sin(s * math.pi/30)) y = y0 - math.floor(r * math.cos(s * math.pi/30)) r = math.random(x10) if r then r=xx - 15 end local x1,y1 = item.screenToClient(x1,y1) y1 = y10 - r m2 = m2 + 1 x1 = x10 + math.floor(r * math.sin(m2 * math.pi/1800)) y1 = y10 - math.floor(r * math.cos(m2 * math.pi/1800)) if r then r=xx - 40 end local x2,y2 = item.screenToClient(x2,y2) y2 = y20 - r h2 = h2 + 1 x2 = x20 + math.floor(r * math.sin(h2 * math.pi/21000)) y2 = y20 - math.floor(r * math.cos(h2 * math.pi/21000)) Canvas.pen.Color = "0xFFFFFF" Canvas.pen.Width = 2 Canvas.line(x, y, xx, xx) --s Canvas.pen.Color = "0xFFFF00" Canvas.pen.Width = 5 Canvas.line(x1, y1, xx, xx) --d Canvas.pen.Color = "0x00ffff" Canvas.pen.Width = 7 Canvas.line(x2, y2, xx, xx) --h Canvas.pen.Color = "0xFF9000" Canvas.pen.Width = 3 Canvas.line(xx1*6, xx1*3, xx1*5, xx1*3) --15 >> 3 Canvas.line(xx1*3, xx1*6, xx1*3, xx1*5) --30 >> 6 Canvas.line(0, xx1*3, xx1, xx1*3) --45 >> 9 Canvas.line(xx1*3, xx1, xx1*3, 0) --60 >> 0-12 bm.TransparentColor=clBlack item.Transparent=true if s >= 60 then s=0 m=m + 1 end if m >= 60 then m=0 h=h + 1 end if h >= 13 then h=1 end ------------------------------------ ix3.caption=(h..":"..m..":"..s) ix3.bringToFront() end if t then t.destroy(); t=nil end t=createTimer() t.Interval = 1000 t.onTimer = test end