version 5.50 0 Form1 1 0 0 0 4 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 238 268 0 0 0 Sub designer addform(Form1,"Form1","",220,220,220)@ addimage(form1,Image1,90,190,80,80,"cCenterImage","",245,245,220,True,False)@ addtimer(form1,Timer1,15,240,1000)@ End Sub @EndOfDesignText@Sub Globals 'Declare the global variables here. Dim aX(4) Dim aY(4) End Sub Sub App_Start Form1.Show Image1.LoadPicture(AppPath & "\Clock.jpg") Timer1.Enabled = true End Sub Sub DrawPointer(x, y, angle,len, pstart, wstart ,wsize, radius, color, line) ' x, y - the co-ordinates of the centre of the pointer ' angle, len - the angle of thepoint 0 to 360, and the length in pixels ' pstart - the start of the head of the pointer away from the centre point : 0 to len ' wstart - the approximate start of each wing away from the centre point: 0 to len ' wsize - the width of each wing in pixels: ' radius - the radius of the hub at the centre of the pointer, can be 0 ' color - the colour of the pointer ' line - a boolean, if true draw a line the length of the pointer angle = angle * cPI / 180 s = Sin(angle) c = Cos(angle) ' set up the point in order to be drawn aX(0) = x + len * s ' far point aY(0) = y - len * c aX(1) = x + wstart * s + wsize * c ' 1st wing point aY(1) = y - wstart * c + wsize * s aX(2) = x + pstart * s ' center point aY(2) = y - pstart * c aX(3) = x + wstart * s - wsize * c ' 2nd wing point aY(3) = y - wstart * c - wsize * s ' draw a line the length of the pointer if wanted If line Then Form1.Line(x,y,aX(0),aY(0),color) End If ' draw the pointer - could parameterize the form and use Control(Formname) to draw Form1.Polygon(aX(),0,aY(),0,4,color,f) ' draw the hub of the pointer Form1.Circle(x,y,radius,color,f) End Sub Sub Timer1_Tick Form1.DrawImage(Image1.Image,65,0) DrawPointer(130,65,((TimeH Mod 12)+TimeM/60)*30,30,0,20,3,5,cgray,true) DrawPointer(130,65,TimeM*6,50,0,30,3,2,cgray,true) DrawPointer(130,65,TimeS*6,55,35,30,5,0,cBlack,false) Form1.DrawImage(Image1.Image,100,150,165,215) DrawPointer(131,182,((TimeH Mod 12)+TimeM/60)*30,15,0,10,2,2,cgray,true) DrawPointer(131,182,TimeM*6,25,0,15,2,2,cgray,true) DrawPointer(131,182,TimeS*6,28,17,15,3,0,cBlack,false) End Sub