شاید شما از قرار دادن افکت های جالب در کارهاتون لذت می برید این هم افکت شعله آتش هست شاید موقع اجرا از این کد خوشتون بیاد .
اول یک Timer ایجاد کنید بعدش کد ادامه مطلب رو وارد کنید .
Private Declare Function SetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As LongPrivate Fire() As BytePrivate Sub Form_Load()Timer1.Interval = 10
Me.AutoRedraw = True
ReDim Fire(0 To 100, 0 To 100)
For x = 0 To 100For y = 0 To 100
Fire(x, y) = 0
Next y
Next x
End SubPrivate Sub Timer1_Timer()On Error Resume Next
Dim x As Integer
Dim y As Integer
Dim Color As Integer
Dim table As ByteFor y = 100 To 0 Step -1For x = 0 To 100
Randomize
Fire(x, y) = Fire(x, y) - Int(Rnd * 4)table = Int(Rnd * 3)Fire(x, y - table) = Fire(x, y)Color = (Int(Fire(x, y) * 3))SetPixel Me.hDC, x + (Rnd * 2), y, RGB(Color + Color, Color, Color / 2)Next x
Next yFor x = 0 To 100For y = 95 To 100
Fire(x, y) = 110
Next y
Next x