Image rotation in a picturebox.

Ibanezmatt13

New member
Joined
Apr 12, 2012
Messages
3
Programming Experience
Beginner
Hi,


I am making a game which requires the rotation of a .gif image within a picturebox.

At the moment, I have programmed the form so that when the right arrow key is pressed, the image is rotated 90 degrees clockwise. However, after coding this event, nothing happens at all.

Here is my code so far. I have a picturebox named picturebox1 with a .gif image on the desktop.

Public Class Form1

Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyValue = Keys.Right Then
PictureBox1.Image.RotateFlip(RotateFlipType.Rotate90FlipNone)
End If
End Sub
End Class



If anybody could suggest why my project is faltering I would be much appreciative.

Many thanks in advance,
Matthew.
 
Add this:
PictureBox1.Refresh()

Here's what it means: Control.Refresh Method (System.Windows.Forms)
 
Back
Top