I'm not finding the correct syntax. This is what I have...
The Bold is where I am failing to convert to hex. What can I do to get this right?Code:Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click If Pathstr <> "" Then Dim bitmap As New Bitmap(Pathstr) Dim LocalMousePosition As Point LocalMousePosition = PictureBox1.PointToClient(Cursor.Position) bgc = bitmap.GetPixel(LocalMousePosition.X, LocalMousePosition.Y) Label12.BackColor = bgc Else MsgBox("Please Drop an image before choosing color") End If ColorDialog1.Color = bgc ColorDialog1.FullOpen = True If ColorDialog1.ShowDialog <> Windows.Forms.DialogResult.Cancel Then Label12.BackColor = ColorDialog1.Color End If Dim intColor2Dec As Integer intColor2Dec = Convert.ToInt32(bgc) TextBox1.Text = Microsoft.VisualBasic.Conversion.Hex(intColor2Dec) End Sub




Reply With Quote
