[ VB 2008 ] COLOR View예제. 본문

[PL]/VB & VB.NET

[ VB 2008 ] COLOR View예제.

객과 함께. 2010. 1. 11. 03:56

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

        Dim aa, bb, cc As String
        Dim bt As Bitmap = PictureBox1.Image
        Dim c As Color = bt.GetPixel(MousePosition.X, MousePosition.Y)

      
        aa = Hex(c.R.ToString())
        bb = Hex(c.G.ToString())
        cc = Hex(c.B.ToString())

      
        TextBox1.Text = c.R.ToString() & "," & c.G.ToString() & "," & c.B.ToString() & "       (#" & aa & bb & cc & ")"
    End Sub