Comparing Colors

lothos12345

Well-known member
Joined
May 2, 2002
Messages
294
Location
Texas
I cannot compare colors, I have a box and I want the program to search each pixel to the left until it finds one that is not white, I just need to know how to programmitically in visual basic.net compare colors. Any help given is greatly appreciated.
 
Youll need to compare the ARGB integer value of the color in your loop.
Code:
For x = 0 To bmp.Width - 1
    For y = 0 To bmp.Height - 1
        If bmp.GetPixel(x, y).ToArgb = -1 Then
            MessageBox.Show("white pixel")
        End If
    Next
Next
 
Last edited by a moderator:
I should have corrected this earlier!
White.ToARGB = 1 or -1
Sorry.
For clarity I have changed the snippet from 0 to -1
 
Back
Top