Hello everybody,
I have a picturebox in which I draw a circle. I then display the time in clock format by moving 3 line objects using the following code. LH is the Hour hand, LM is the minute hand and LS is the seconds hand.
In general the code works for most times however for certain times it doesn't look right. For example 10:35 will look more like 11:35.
Anybody have an idea how to fix this, is there more precise positioning of the clock hands? Thanks for any help.
Code:LH.X1 = picClock.ScaleWidth / 2 LH.Y1 = picClock.ScaleHeight / 2 LM.X1 = picClock.ScaleWidth / 2 LM.Y1 = picClock.ScaleHeight / 2 LS.X1 = picClock.ScaleWidth / 2 LS.Y1 = picClock.ScaleHeight / 2 LH.X2 = 0.65 * (picClock.ScaleWidth / 2) * Cos(PI / 180 * (30 * intTotalHours - 90)) + LH.X1 LH.Y2 = 0.65 * (picClock.ScaleHeight / 2) * Sin(PI / 180 * (30 * intTotalHours - 90)) + LH.Y1 LM.X2 = 0.85 * (picClock.ScaleWidth / 2) * Cos(PI / 180 * (6 * intMinute - 90)) + LH.X1 LM.Y2 = 0.85 * (picClock.ScaleHeight / 2) * Sin(PI / 180 * (6 * intMinute - 90)) + LH.Y1 LS.X2 = 0.9 * (picClock.ScaleHeight / 2) * Cos(PI / 180 * (6 * intSecond - 90)) + LH.X1 LS.Y2 = 0.9 * (picClock.ScaleHeight / 2) * Sin(PI / 180 * (6 * intSecond - 90)) + LH.Y1




Reply With Quote