Here you go:I think that will work. Look at what I've changed, it'll help you to figure out where you went wrong.VB Code:
Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long Private Sub Form_MouseDown(...) Dim Radian As Double, PixelX As Single, PixelY As Single, Angle As Double For Angle = 0 To 359.5 Step 0.5 Radian = Angle * (3.1415926 / 180) PixelX = CentreX + Cos(Radian) * Radius PixelY = CentreY + Sin(Radian) * Radius SetPixelV Picture1.hDC, PixelX, PixelY, RGB(0, 0, 0) Next Angle End Sub Private Sub Form_Load() CentreX = 100 CentreY = 100 Radius = 50 End Sub




Reply With Quote