Hi all,
I am new to
VB.net and have a question. I have created a bitmap image of a form, and I am attempting to loop through pixels, starting with the pixel at a mouse-click and color them blue if they are gainsboro. The For loop is working correctly, but if I click on a color which I know is gainsboro, the loop never seems to enter the if statement. Any help for this rookie would be greatly appreciated! A bit of code is below.
If e.Button = MouseButtons.Left Then
StartX = e.X
StartY = e.Y
For i = StartY To 1 Step -1
color1 = m_PrintBitmap.GetPixel(StartX, i)
If color1.ToString.Equals(gainsboro.ToString) Then
m_PrintBitmap.SetPixel(StartX, i, blue)
ElseIf color1.ToString = blue.ToString Then
Exit For
End If
Next i
End If