1. From Login
Listing Program From Login :
Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
UserName.Text = ""
Password.Text = ""
Password.PasswordChar = "*"
End Sub
Private Sub BtnOK_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnOK.Click
If
UserName.Text = "Syahril" And Password.Text = "123"
Then
MsgBox("Selamat
Datang !")
Me.Hide()
MenuUtama.Show()
Else
MsgBox("Maaf!
Username / Password Salah!")
UserName.Text = ""
Password.Text = ""
End If
End Sub
Private Sub BtnKELUAR_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnKELUAR.Click
End
End Sub
End Class
2. Menu Utama
Listing Program Menu Utama :
Public Class MenuUtama
Private Sub MenuUtamaToolStripMenuItem3_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
MenuUtamaToolStripMenuItem3.Click
Gambar.MdiParent = Me
Gambar.Show()
End Sub
Private Sub GambarToolStripMenuItem4_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
GambarToolStripMenuItem4.Click
End
End Sub
End Class
3. Pengolahan Citra
Listing Program Pengolahan Citra :
Public Class Gambar
Private Sub BtnGrayscale_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnGrayscale.Click
Dim rt,
pc, pb As Integer
Dim vm,
vh, vB As Integer
Dim
gambar2 As Bitmap
Picturebox2.Image = picturebox1.Image
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
Next
Picturebox2.Image = gambar2
Picturebox2.Refresh()
End Sub
End Class
Berikut Hasilnya :
Tidak ada komentar