1
我面对的是一件看起来非常艰巨的任务。我需要在一个PictureBox中以15度为增量旋转图像。经过相当长的一段时间寻找互联网的深度,我没有找到任何事情来完成这项任务。我能想出最接近的事情是用90度翻转:以15度的增量旋转图像?
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
InitializeBitmap()
End Sub
Dim bitmap1 As Bitmap
Private Sub InitializeBitmap()
Try
bitmap1 = CType(Bitmap.FromFile("G:\Documents\Dawson\Semster 3\Visual Basic I\Test\subs\subs\Wheel.bmp"), Bitmap)
PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
PictureBox1.Image = bitmap1
Catch ex As System.IO.FileNotFoundException
MessageBox.Show("There was an error. Check the path to the bitmap.")
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
If bitmap1 IsNot Nothing Then
bitmap1.RotateFlip(RotateFlipType.Rotate90FlipXY)
PictureBox1.Image = bitmap1
End If
End Sub
我需要的代码,将15倍的增量翻转我的形象是;没有更多,也没有少。
任何愿意向我提供此代码的人将不胜感激。谢谢你的时间。
此链接的代码很好地转换为VB。它使我的工作很好地完成。十分感谢你的帮助! –