How to define and use a bitmap and graphics object and animated display of image in a picture box using a timer

Bitmap is an object used to work with images defined by pixel data.

You can create images using one of the Bitmap constructors. Images are drawn on the screen or in memory using the DrawImage method of the Graphics object.

The Graphics class provides methods for drawing objects on the display device.

       Public b As Bitmap
Public g As Graphics

Public WithEvents TimerAnimation As Timer

Me.TimerAnimation = New Timer
        Me.TimerAnimation.Interval = 100  ‘millisec
        Me.TimerAnimation.Start()

        b = New Bitmap(Me.PictureBoxScene.Width, Me.PictureBoxScene.Height)
        g = Graphics.FromImage(b)

Leave a Reply

Create your own website, free on WordPress.com.Create your own website.
Start free