Затмение луны в Java отобразить на Visual Basic - VB
Формулировка задачи:
затмение луны.rar
Как бы отобразить это на бейсике...?
Решение задачи: «Затмение луны в Java отобразить на Visual Basic»
textual
Листинг программы
Option Explicit Private Sub Draw() Static n As Long, p As Single, w As Long, c As Long, d As Single, x As Single, y As Single, b As Single, _ px As Single, py As Single, cx As Single, cy As Single, cc As Long, a1 As Single, a2 As Single, q As Single Call Cls: Rnd -1 For n = 0 To 1000 w = Rnd * 10 * Abs(Sin(Rnd * 3.14 + p)) + 1 d = 200 / w: c = 0: x = Rnd * ScaleWidth: y = Rnd * ScaleWidth: b = Rnd Do While w c = c + d: ForeColor = RGB(c * b, c * b, c): DrawWidth = w PSet (x, y): w = w - 1 Loop: p = p + 0.0001 Next px = px + 0.5: py = py - 0.5 If cc = 0 Then Call Randomize: cx = Rnd * ScaleWidth: cy = Rnd * ScaleHeight: cc = 51: a1 = (Rnd * 3 - 6) + 15: a2 = (Rnd * 3 - 6) + 15 Else cc = cc - 1: x = cx: y = cy: c = 51 - cc: d = (51 - c) / c * 4 q = 0: CurrentX = cx: CurrentY = cy For n = 0 To c ForeColor = RGB(q, q, q) DrawWidth = ((n + 1) / 10) + 1 Line -(x, y) x = x + a1: y = y + a2 q = q + d Next End If picMask.Cls PaintPicture picMask.Picture, ScaleWidth / 2, ScaleHeight / 2, , , , , , , &H220326 'DSna picMask.PaintPicture picMask.Picture, px - picMask.ScaleWidth, py + picMask.ScaleHeight, , , , , , , &H220326 PaintPicture picMask.Image, ScaleWidth / 2, ScaleHeight / 2, , , , , , , vbSrcPaint PaintPicture picMoon.Image, ScaleWidth / 2, ScaleHeight / 2, , , , , , , vbSrcAnd End Sub Private Sub Form_Click() Unload Me End Sub Private Sub Form_Load() Randomize Move 0, 0, Screen.Width, Screen.Height End Sub Private Sub tmrTimer_Timer() Draw End Sub
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д