Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining colour mix of a solid colour image. 1

Status
Not open for further replies.

rhofing

MIS
Dec 12, 2001
25
0
0
CA
Hello, I need to be able to derive which colours, and their percentages, that make up a solid color image (a square) for a chemical analysis application I am writing in VB.NET. For example, a pink square. I need to be able to determine which colors are being used (red and white in this case) and which percentage of each exist. Can someone point me to a code source/sample/control that will do this (or show me how it can be done)?

Also, can anyone suggest a scanner control? I only need very basic functionality to scan a chemical stip (it will always be a square). I do not need to do anything with it, like crop, convert, transform, etc. All I need to do is scan it and then determine the colours involved and their percentages (as I explain above).

Thanks!

Ric

 
If you have a Bitmap object named "bmp", you can find the color of a pixel:

Code:
Dim R As Integer
Dim G As Integer
Dim B As Integer
R = bmp.GetPixel(1, 1).R()
G = bmp.GetPixel(1, 1).G()
B = bmp.GetPixel(1, 1).B()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top