|
-
Aug 10th, 2007, 09:46 PM
#1
Re: [RESOLVED] If pixel equals X...help
What's wrong with Color.Black ?
-
Aug 13th, 2007, 08:21 AM
#2
Thread Starter
Addicted Member
Re: [RESOLVED] If pixel equals X...help
 Originally Posted by penagate
What's wrong with Color.Black ?
Thats what i tried in the beginning. My image had a black background with a single white dot in the middle. I ran... If Bitmap.Getpixel = color.black then end ... and it would just run through without finding anything. I wonder if it is something to do with using a 24bbp image or something. Either way i solved it by using color.fromargb().
-
Aug 13th, 2007, 10:33 AM
#3
Re: [RESOLVED] If pixel equals X...help
I also had problems directly comparing a known pixel color to predefined color even though their rgb and Argb values were the same.
For 'normal' and particularly for user defined colors (which are nameless) you can also use the argb value for comparison - it is only one integer instead of 3+1.
Code:
'-16777216 is black, -1 is white etc.
If myBitmap.GetPixel(xx, yy).ToArgb <> Color.Black.ToArgb Then
MsgBox(xx & ", " & yy)
End If
For your second question try this link.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|