Public Class Form1
Dim gambar2
As Bitmap
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim Pb,
Pc As Integer
Dim Vm,
Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
For Pb
= 0 To gambar2.Height - 1
For
Pc = 0 To Gambar2.Width - 1
Vm = Gambar2.Getpixel(Pc, Pb).R
- 10
Vh = Gambar2.Getpixel(Pc, Pb).G
Vb = Gambar2.Getpixel(Pc, Pb).B
If
Vm <= 0 Then Vm = 0
Gambar2.Setpixel(Pc, Pb,
Color.FromArgb(Vm, Vh, Vb))
Next
PictureBox2.Image = Gambar2
PictureBox2.Refresh()
Next
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim Pb,
Pc As Integer
Dim Vm,
Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
For Pb
= 0 To gambar2.Height - 1
For
Pc = 0 To gambar2.Width - 1
Vm = gambar2.GetPixel(Pc, Pb).R
+ 10
Vh = gambar2.GetPixel(Pc, Pb).G
Vb = gambar2.GetPixel(Pc, Pb).B
If
Vm >= 255 Then Vm = 255
gambar2.SetPixel(Pc, Pb,
Color.FromArgb(Vm, Vh, Vb))
Next
PictureBox2.Image = gambar2
PictureBox2.Refresh()
Next
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim Pb,
Pc As Integer
Dim Rt,
Vm, Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
For Pb
= 0 To gambar2.Height - 1
For
Pc = 0 To gambar2.Width - 1
Vm = gambar2.GetPixel(Pc, Pb).R
Vh = gambar2.GetPixel(Pc, Pb).G
Vb = gambar2.GetPixel(Pc, Pb).B
Rt = (Vm + Vh + Vb) / 3
gambar2.SetPixel(Pc, Pb,
Color.FromArgb(Rt, Rt, Rt))
Next
PictureBox2.Image = gambar2
PictureBox2.Refresh()
Next
End Sub
Private Sub Button4_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Dim Pb,
Pc As Integer
Dim Vm,
Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
For Pb
= 0 To gambar2.Height - 1
For
Pc = 0 To gambar2.Width - 1
Vm = gambar2.GetPixel(Pc, Pb).R
+ 5
Vh = gambar2.GetPixel(Pc, Pb).G
+ 5
Vb = gambar2.GetPixel(Pc, Pb).B
+ 5
If
Vm >= 255 Then Vm = 255
If
Vb >= 255 Then Vb = 255
If
Vh >= 255 Then Vh = 255
gambar2.SetPixel(Pc, Pb,
Color.FromArgb(Vm, Vh, Vb))
Next
PictureBox2.Image = gambar2
PictureBox2.Refresh()
Next
End Sub
Private Sub Button5_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim Pb,
Pc As Integer
Dim Vm,
Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
For Pb
= 0 To gambar2.Height - 1
For
Pc = 0 To gambar2.Width - 1
Vm = gambar2.GetPixel(Pc, Pb).R
- 5
Vh = gambar2.GetPixel(Pc, Pb).G
- 5
Vb = gambar2.GetPixel(Pc, Pb).B
- 5
If
Vm <= 0 Then Vm = 0
If
Vb <= 0 Then Vb = 0
If
Vh <= 0 Then Vh = 0
gambar2.SetPixel(Pc, Pb,
Color.FromArgb(Vm, Vh, Vb))
Next
PictureBox2.Image = gambar2
PictureBox2.Refresh()
Next
End Sub
Private Sub Button6_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
Dim Pb,
Pc As Integer
Dim Vm,
Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
Dim
Gambar3 As Bitmap = New
Bitmap(PictureBox2.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
Private Sub Button7_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
Dim Pb,
Pc As Integer
Dim Vm,
Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
For Pb
= 0 To gambar2.Height - 1
For
Pc = 0 To gambar2.Width - 1
Vm = gambar2.GetPixel(Pc, Pb).R
Vh = gambar2.GetPixel(Pc, Pb).G
- 10
Vb = gambar2.GetPixel(Pc, Pb).B
If
Vh <= 0 Then Vh = 0
gambar2.SetPixel(Pc, Pb,
Color.FromArgb(Vm, Vh, Vb))
Next
PictureBox2.Image = gambar2
PictureBox2.Refresh()
Next
End Sub
Private Sub Button8_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button8.Click
Dim Pb,
Pc As Integer
Dim Vm,
Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
For Pb
= 0 To gambar2.Height - 1
For
Pc = 0 To gambar2.Width - 1
Vm = gambar2.GetPixel(Pc, Pb).R
Vh = gambar2.GetPixel(Pc, Pb).G
+ 10
Vb = gambar2.GetPixel(Pc, Pb).B
If
Vh >= 255 Then Vh = 255
gambar2.SetPixel(Pc, Pb,
Color.FromArgb(Vm, Vh, Vb))
Next
PictureBox2.Image = gambar2
PictureBox2.Refresh()
Next
End Sub
Private Sub Button9_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button9.Click
Dim Pb,
Pc As Integer
Dim Vm,
Vh, Vb As Double
gambar2 = New
Bitmap(PictureBox2.Image)
For Pb
= 0 To gambar2.Height - 1
For
Pc = 0 To gambar2.Width - 1
Vm = 255 - gambar2.GetPixel(Pc,
Pb).R
Vh = 255 - gambar2.GetPixel(Pc,
Pb).G
Vb = 255 - gambar2.GetPixel(Pc,
Pb).B
If
Vm <= 0 Then Vm = 0
If
Vb <= 0 Then Vb = 0
If
Vh <= 0 Then Vh = 0
gambar2.SetPixel(Pc, Pb,
Color.FromArgb(Vm, Vh, Vb))
Next
PictureBox2.Image = gambar2
PictureBox2.Refresh()
Next
End Sub
Private Sub Button10_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button10.Click
End
End Sub
End Class
Posting Komentar