Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PictureBox2.Image = PictureBox1.Image
End Sub
Private Sub btnRotasi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRotasi.Click
Dim Pb, Pc As Integer
Dim vM, vH, vB As Double
Dim gambar2 = New Bitmap(PictureBox1.Image)
Dim gambar3 As Bitmap = New Bitmap(PictureBox1.Image)
For Pb = gambar2.Height - 1 To 0 Step -1
For Pc = gambar2.Width - 1 To 0 Step -1
vM = gambar2.GetPixel(Pc, Pb).R
vH = gambar2.GetPixel(Pc, Pb).G
vB = gambar2.GetPixel(Pc, Pb).B
gambar3.SetPixel(gambar2.Width - 1 - Pc, gambar2.Height - 1 - Pb, Color.FromArgb(vM, vH, vB))
Next
PictureBox2.Image = gambar3
PictureBox2.Refresh()
Next
End Sub
End Class
Lihat hasil tampilan program awal

Setelah button Rotasi di click

0 komentar:
Posting Komentar