Click here to Skip to main content
15,121,741 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hello everybody,

I m work on a project based on Biometrics/ Fingerprint.
I completed mostly modules based on.

but at last stage... Auto counting fingerprint ridge between two points from image... hanged me.


I work done this in Java Perfectly.. But problem in C#.

C#
My java code here:

java.util.ArrayList arr = (java.util.ArrayList)getco_ordinate(width, height, x1, y1, x2, y2);
java.awt.Point pp = (java.awt.Point)arr.get(i);
int px = pp.x;
int py = pp.y;
java.awt.image.BufferedImage currentworkingprocessimage;
getARGBPixelData(currentworkingprocessimage.getRGB(px, py));

/*method*/
public void getARGBPixelData(int pixel)
{
java.lang.String pixelARGBData = "";
a = pixel >> 24 & 0xff;
r = pixel >> 16 & 0xff;
g = pixel >> 8 & 0xff;
b = pixel & 0xff;
}

every thing ok but problem line is : 
"java.awt.image.BufferedImage currentworkingprocessimage;
getARGBPixelData(currentworkingprocessimage.getRGB(px, py));"

there r no getRGB method in System.Drawing.Bitmap or System.Windows.Media.BitmapImage

any option doing this



please help..

thanks in advance

What I have tried:

i have tried but result null...
Posted
Updated 23-Mar-16 8:09am
v2
Comments
Matt T Heffron 22-Mar-16 12:32pm
   
So it sounds like the problem is in converting your Java implementation to C#.
In the "What I have tried:" section, show us the relevant parts of both implementations.

This way we can see how to help. Right now there's nothing we can do.
Rajesh Lagaria 23-Mar-16 1:24am
   
My java code here:

java.util.ArrayList arr = (java.util.ArrayList)getco_ordinate(width, height, x1, y1, x2, y2);
java.awt.Point pp = (java.awt.Point)arr.get(i);
int px = pp.x;
int py = pp.y;
java.awt.image.BufferedImage currentworkingprocessimage;
getARGBPixelData(currentworkingprocessimage.getRGB(px, py));

/*method*/
public void getARGBPixelData(int pixel)
{
java.lang.String pixelARGBData = "";
a = pixel >> 24 & 0xff;
r = pixel >> 16 & 0xff;
g = pixel >> 8 & 0xff;
b = pixel & 0xff;
}

every thing ok but problem line is :
"java.awt.image.BufferedImage currentworkingprocessimage;
getARGBPixelData(currentworkingprocessimage.getRGB(px, py));"

there r no getRGB method in System.Drawing.Bitmap or System.Windows.Media.BitmapImage

any option doing this
Sinisa Hajnal 23-Mar-16 3:30am
   
Please move this code to the question (use Improve question link). Comments are hard to read. Thank you.

There is System.Drawing.Color name space that has several ToArgb and FromArgb type methods and converters. There is also System.Windows.Media having some color conversion methods (cannot remember exact names right now).
Patrice T 23-Mar-16 14:09pm
   
Use Improve question to update your question.

1 solution

In System.Drawing.Bitmap there is a GetPixel(x,y) method that returns a System.Drawing.Color value.
The Color has ToArgb and FromArgb and ToString methods which should serve your needs.

NOTE: the GetPixel(x,y) method is exceedingly slow. See Sergey's Solution 3 discussion here[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900