Monday 27 January 2014

My Profil

January 27, 2014 0 Comments





Dan inilah aku :
Nama lengkap ku Kristina Nancy Lumban Gaol,
Biasa dipanggil Tina atau Nancy
Aku lahir tanggal 31 Maret tahun 1994
Kira - kira masih 20 tahun lah.. :D

Kegiatan sehari - hari ya memasak, bernyanyi, bermain Piano, Taekwondo, menari dan jalan - jalan bareng sahabat ku Dita,, dan tidak lupa juga Kuliah :D

Ayah dan Ibu ku adalah Guru, yang mengajar bahasa Inggris. Tidak lupa juga mereka selalu berbahasa inggris dirumah kepada kami, agar kami terbiasa dan lancar.

Aku adalah tipe cewek yang biasa - biasa saja, tapi bisa melakukan hal luar biasa :D #Lebay
Dan juga tipe cewek yang paling Setia terhadap pasangan, dan Selalu care terhadap teman - teman. :)

#Chagiya :(

January 27, 2014 0 Comments


Apa yang akan kamu lakukan jika orang yang kamu cintai pergi meninggalkan mu ??
Ntahlah,,
Aku tak tau harus mengatakan apa, saat orang yang aku cintai pergi dari hadapan ku,
Marah, Kecewa, Kesal, Sedih dan Menangis,
Itulah yang bisa ku lakukan,
Mungkin bagi sebagian orang, disaat orang yang dicintainya pergi meninggalkannya,
akan mudah baginya untuk mencari pengganti dia,
Tapi tidak bagi diriku,

Ntah apa yang ku rasakan tentang dia,
Tapi yang jelas, tidak mudah bagi ku mencari penggantinya,
Banyak cinta yang datang mendekatiku,
Tapi ku tetap bertahan pada dirinya,
Karna hanya dia yang ada dalam hatiku,
Walau rasa sakit yang sering ku dapatkan.

Pernah ku berpikir untuk lari darinya ?
Tapi berulang kali ku coba tak akan pernah bisa.
Walau ku tahu ada orang lain dihatinya.

Sekarang ku tersadar kalau sejak awal,
Aku tak akan pernah punya tempat dihatinya,
Dan perpisahan lah yang terbaik saat ini,
Bukan perpisahan yang ku tangisi tapi Pertemuan dengannya yang ku sesali.
Walau berat melepasnya tapi harus ku lakukan.
Biarlah yang tersisa hanya Kenangan dan Sakit dalam hati.

Thursday 16 January 2014

PENGOLAHAN CITRA

January 16, 2014 0 Comments

Tugas Belajar Belajar Bahasa Pemrograman 


Kali ini saya mau memposting tugas kuliah saya tentang pengolahan citra.

Keterangan :
Form 1 : Form Login
Form 2 : Form Pengolahan Citra

Terlebih dahulu membuat Form Loginnya.


Bentuk Form Login

Listing Program Form 1 :

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Password.PasswordChar = "*"
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        If Username.Text = "" Or Password.Text = "" Then
            MsgBox("Maaf, Username Dan Password Belum Di Input!!")
            Username.Focus()
        ElseIf Username.Text = "Kristina" And Password.Text = "123" Then
            MsgBox("Selamat Datang")
            Form2.Show()
            Me.Hide()
        Else
            MsgBox("Maaf! Username Dan Password Salah!")
            Username.Text = ""
            Password.Text = ""
            Username.Focus()
        End If
    End Sub

    Private Sub Password_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Password.KeyPress
        If Asc(e.KeyChar) = 13 Then
            If Username.Text = "Kristina" And Password.Text = "123" Then
                MsgBox("Selamat Datang")
                Form2.Show()
                Me.Hide()
            Else
                MsgBox("Maaf, Password yang anda masukkan salah!!")
                Username.Text = ""
                Password.Text = ""
            End If
        End If
    End Sub


Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
        Me.Close()
    End Sub

Klik double Menustrip :
Listring Program 

    Private Sub PengolahanCitraToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PengolahanCitraToolStripMenuItem.Click
        Form2.MdiParent = Me
        Form2.Show()
    End Sub

    Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click
        Me.Close()
    End Sub
End Class


Gambar Penggunaan Menustrip


Hasil Login

Selanjutnya buat Form Pengolahan Citranya :


Bentuk Form awal pengolahan citra

Listing Program  Form 2 :

Public Class Form2
    Dim gambar2 As Bitmap

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PictureBox2.Image = PictureBox1.Image
    End Sub

Button 1 : Button - Hijau

    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

Button 2 : Button + Hijau

    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

Button 3 : Button Greyscale

    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

Button 4 : - Merah

    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

Button 5 : + Merah

    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

Button 6 : Button Rotate

    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(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

Button 7 : - Britness

    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

Button 8 : + Britness

    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

Button 9 : Button Negativ

    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

Button 10 : Button Finish

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        End
    End Sub
End Class

Dan dibawah ini hasilnya :



Hasil Button - Hijau


Hasil Button Greyscale


Hasil Button - Merah


Hasil Button + Merah


Hasil Button - Britness


Hasil Button + Britness


Silahkan Mencoba :)