我面临着一项似乎非常艰巨的任务。我需要在 PictureBox 内以 15 度的增量旋转图像。在花了很长时间搜索互联网的深度之后,我还没有找到任何可以完成这项任务的东西。我能想到的最接近的方法是使用以下方法进行 90 度翻转:
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 度增量的代码;仅此而已,也仅此而已。
任何愿意向我提供此代码的人将不胜感激。谢谢你的时间。