Pages

Jumat, 17 Januari 2014

Program Penggajian Pegawai



Masukkan Perintah Di Bawah Ini


Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        nik.Items.Add("PM010")
        nik.Items.Add("PS111")
        nik.Items.Add("KU101")
        nik.Items.Add("GD100")
        nik.Items.Add("PM011")
        jabatan.Items.Add("Kepala Divisi")
        jabatan.Items.Add("Staf")
        jabatan.Items.Add("Wakil Kepala")
        status.Items.Add("Menikah")
        status.Items.Add("Belum Menikah")
        Dim h As Integer
        For h = 1 To 4
            jumlah_Anak.Items.Add(h)
        Next h
    End Sub

    Private Sub nama_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nama.TextChanged



        If jabatan.Text Then
            jabatan.Text = "kepala"
            jabatan.Text = "staf"
            jabatan.Text = "wakil"



        End If

    End Sub


    Private Sub nik_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nik.SelectedIndexChanged
        Select Case nik.Text
            Case "PM010"
                Nama.Text = "Awal"
            Case "PS111"
                Nama.Text = "Dasner"
            Case "KU101"
                nama.Text = "Mulia"
            Case "GD100"
                nama.Text = "Doni"
            Case "PM011"
                Nama.Text = "Taufik""
        End Select
        Dim M As String
        M = Microsoft.VisualBasic.Left(nik.Text, 2)
        Select Case M
            Case "PM"
                bagian.Text = "Pemasaran"
            Case "PS"
                bagian.Text = "Personalia"
            Case "KU"
                bagian.Text = "Keuangan"
            Case "GD"
                bagian.Text = "Gudang"
        End Select
    End Sub


    Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
        Select Case jabatan.Text
            Case "Kepala Divisi"
                Gaji_pokok.Text = 5000000
                pajak.Text = 0.1 * Gaji_pokok.Text
            Case "Staf"
                Gaji_pokok.Text = 2000000
                pajak.Text = 0.1 * Gaji_pokok.Text
            Case "Wakil Kepala"
                Gaji_pokok.Text = 3500000
                pajak.Text = 0.1 * Gaji_pokok.Text
        End Select
    End Sub


    Private Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
        Select Case Status.Text
            Case "Menikah"
                tunjangan_keluarga.Text = 0.15 * Gaji_pokok.Text
            Case "Belum Menikah"
                tunjangan_keluarga.Text = 0 * Gaji_pokok.Text
        End Select
    End Sub

    Private Sub jumnak_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jumlah_Anak.SelectedIndexChanged
        Select Case jumlah_Anak.Text
            Case "1"
                jumlah_Anak.Text = 0.5 * total_gaji.Text
            Case "2"
                jumlah_Anak.Text = 0.1 * total_gaji.Text
            Case "3"
                jumlah_Anak.Text = "Berlaku Untuk Dua Anak saja"
            Case "4"
                jumlah_Anak.Text = "Berlaku Untuk Dua Anak saja"
        End Select
    End Sub

    Private Sub Total_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles total_gaji.KeyPress
        total_gaji.Text = Val(Gaji_pokok.Text) + Val(tunjangan_keluarga.Text) + Val(jumlah_Anak.Text) - pajak.Text
    End Sub

 
     


    Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click
        NIK.Text = ""
        Nama.Text = ""
        Bagian.Text = ""
        jabatan.Text = ""
        total_gaji.Text = ""
        pajak.Text = ""
        status.Text = ""
        jumlah_Anak.Text = ""
        tunjangan_keluarga.Text = ""
        Gaji_pokok.Text = ""
        tunjangan_anak.Text = ""
    End Sub

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

Pencitraan









Setelah membuat form seperti di atas masukkan program di bawah ini :

Public Class Form1
    Dim gambar2 As Bitmap

    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 Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PictureBox2.Image = PictureBox1.Image
    End Sub

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

    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
 

Blogger news

Blogroll

About