Public Sub rotateimage()
Dim x As Long
Dim y As Long
Picture2.Height = Picture1.Width
Picture2.Width = Picture1.Height
For x = 0 To Picture1.Width
For y = 0 To Picture1.Height
Call SetPixel(Picture2.hdc, _
y, x, GetPixel(Picture1.hdc, x, y))
Next
If x Mod 50 = 0 Then
DoEvents
Picture2.Refresh
End If
Next
DoEvents
Picture2.Refresh
End Sub