lothos12345 Posted October 14, 2005 Posted October 14, 2005 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. Quote
*Experts* DiverDan Posted October 14, 2005 *Experts* Posted October 14, 2005 (edited) You'll need to compare the ARGB integer value of the color in your loop. 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 Edited October 14, 2005 by DiverDan Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
IngisKahn Posted October 14, 2005 Posted October 14, 2005 0 is black, 0xFFFFFF is white (ignoring alpha). :) Quote "Who is John Galt?"
*Experts* DiverDan Posted October 14, 2005 *Experts* Posted October 14, 2005 I should have corrected this earlier! White.ToARGB = 1 or -1 Sorry. For clarity I have changed the snippet from 0 to -1 Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.