- Код: Выделить всё
Dim ii As Integer
Private Sub Command1_Click()
Call Destroy
End
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call Destroy
End Sub
Private Sub refr()
BitBlt CDC, 0, 0, 400, 400, MDC2, 0, 0, SRCCOPY
End Sub
Private Sub Create()
Dim pict As String
Select Case ii
Case 1: pict = "red.bmp"
Case 2: pict = "red1.bmp"
Case 3: pict = "red2.bmp"
Case 4: pict = "red3.bmp"
Case 5: pict = "red4.bmp"
End Select
CDC = GetDC(Form1.hwnd)
MDC2 = CreateCompatibleDC(CDC)
MBM2 = CreateCompatibleBitmap(CDC, 400, 400)
ReleaseDC Form1.hwnd, CDC
SelectObject MDC2, LoadPicture(pict)
End Sub
Private Sub Destroy()
DeleteObject MBM2
DeleteDC MDC2
End Sub
Private Sub Timer1_Timer()
ii = ii + 1
If ii > 5 Then ii = 1
Call Create
Call refr
Call Destroy
End Sub