Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: Colors Detection

202| Fri, 08 Feb 2008 14:01:00 GMT| kittianand| Comments (1)
Hai friends,

can any body help to find a specefic color in picture box. Here imporatant thing is i have to gather all the pixcels whos value are near (say tolerence of +- 10%) the selected color.

supose if the user selected red color, I have to selecte all the light red to dark red pixcels according the tolerence.

Can any body tell me such image analysis algorithms. Please tell me if any use ful URLs.

Keywords & Tags: colors, detection, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/80646/
 
«« Prev - Next »» 1 helpful answers below.
GetPicel Api can tell you the RGB color of a pixel
'--
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
'--
Cycling trough all the pixels of a pictureBox, you could know the amount of red-green.blue they have.
Once you determined the range of values you would accept to select, you still have a matter: how to show the selection? May be you could use another picture to draw on it selected pixels only.
You can draw on second picture using Pset (picDest.Pset...) or
the setPixel api
'--
Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long

'--
...
To get something related with gradient, you could look at this:
http://www.1delphistreet.com/URLSEO/vb/scripts/ShowCode!asp/txtCodeId!49709/lngWid!1/anyname.htm
(Sorry, do not know how good it is: I do not usually work a lot with graphic)

cimperiali | Fri, 09 Nov 2007 23:28:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories