If @min <> 0 Then
_DrawNeedle($graph, $hourNeedle, $aH[0], $aH[1], @HOUR * 30 + (@MIN / 2))
Else
_DrawNeedle($graph, $hourNeedle, $aH[0], $aH[1], @HOUR * 30)
EndIf
If @sec <> 0 Then
_DrawNeedle($graph, $minuteNeedle, $aM[0], $aM[1], @MIN * 6 + (@SEC / 10))
Else
_DrawNeedle($graph, $minuteNeedle, $aM[0], $aM[1], @MIN * 6)
EndIf
Totally unnecessary? If @MIN = 0 Then @MIN / 2 = 0. That's not divide BY zero; it's dividing zero by 2 or 10. The above won't make any difference. I experimented with the following replacement for _DrawNeedle():
Func _DrawNeedle($graph, $pNeedle, $nNeedleCenterX, $nNeedleCenterY, $rAngle)
Local $status = DllCall($ghGDIPDll, "int", "GdipRotateWorldTransform", "hwnd", $graph, "float", $rAngle, "int", 1)
$status = DllCall($ghGDIPDll, "int", "GdipTranslateWorldTransform", "hwnd", $graph, "float", $aD[0], "float", $aD[1], "int", 1)
_GDIPlus_GraphicsDrawImageRect($graph, $pNeedle, -$nNeedleCenterX - ($rAngle = 180), -$nNeedleCenterY - ($rAngle = 180), _
_GDIPlus_ImageGetWidth($pNeedle), _GDIPlus_ImageGetHeight($pNeedle))
$status = DllCall($ghGDIPDll, "int", "GdipResetWorldTransform", "hwnd", $graph)
EndFunc ;==>_DrawNeedle
That seems to solve the jump but it's not very elegant. I'm not sure why GDI+ is getting the rotation wrong :-/