Rabu, 13 Maret 2013

Mendapatkan Nilai dan Kordinat Pixel Pada picturebox Vb.net

Asalamualaikum


Langsung saja  untuk mendapatkan nilai RGB dan kordinat (x,y) picturebox vb.net 2010 adalah sebagai berikut :


> Desain Form

1.picturebox
2.textbox


 

> KODE
Public Class Form1

    Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown

        Dim bcolor As Color
        Dim picturea As New Bitmap(PictureBox1.Image)
        Dim t As Double, s As Double, l As Double

        bcolor = picturea.GetPixel(e.X, e.Y)
        TextBox1.Text = "X  :" & e.X & "  y :" & e.Y & "   R  :" & bcolor.R & "   G  :" & bcolor.G & "   B   :" & bcolor.B


    End Sub
End Class




>Hasilnya





 Semoga bermanfaaat   (" majuterus Image prosesing indonesia ")


  




Tidak ada komentar:

Posting Komentar

how coffee can prevent cancer

Coffee and Cancer: An Examination of the Relationship   Coffee, one of the most consumed beverages worldwide, has been the subject of extens...