P
patrick
Im using getRGB in a java application to identify a particular image from
a (non java) windows application. I take a screenshot and use the method
below.
When I get a known value or very close to it I know that a particular image
is showing.
This all works perfectly on my own PC. But on a second PC the windows
application looks different and I fail to identify the image.
Im not sure there is an easy or any solution to this.
presumably one gets different values from getRGB depending on which version
of Windows. (im not interested in other platforms)
Is there a way of identifying the native 'look and feel' of this non java
application? and would there be a way of converting an RGB values.?
thanks
patrick
[The java application on my PC has the java look and feel and on the second
metal I think. It uses getSystemLookAndFeelClassName() ]
//return a number identifying the image within the rect =area in image1.:
public long getrgb (BufferedImage image1,Rectangle area)
{ long myRGB=0L,x=0L;
for(int i=area.x;i<(area.x+area.width);i++)
{
for(int j=area.y;j<(area.y+area.height);j++)
{ x=(long)image1.getRGB(i,j);
myRGB=myRGB + x;
} //
} // end for width
myRGB= myRGB/1000000L;
return myRGB;
}
a (non java) windows application. I take a screenshot and use the method
below.
When I get a known value or very close to it I know that a particular image
is showing.
This all works perfectly on my own PC. But on a second PC the windows
application looks different and I fail to identify the image.
Im not sure there is an easy or any solution to this.
presumably one gets different values from getRGB depending on which version
of Windows. (im not interested in other platforms)
Is there a way of identifying the native 'look and feel' of this non java
application? and would there be a way of converting an RGB values.?
thanks
patrick
[The java application on my PC has the java look and feel and on the second
metal I think. It uses getSystemLookAndFeelClassName() ]
//return a number identifying the image within the rect =area in image1.:
public long getrgb (BufferedImage image1,Rectangle area)
{ long myRGB=0L,x=0L;
for(int i=area.x;i<(area.x+area.width);i++)
{
for(int j=area.y;j<(area.y+area.height);j++)
{ x=(long)image1.getRGB(i,j);
myRGB=myRGB + x;
} //
} // end for width
myRGB= myRGB/1000000L;
return myRGB;
}