11-04-2012 05:27 PM - edited 11-04-2012 05:43 PM
Hi,
I have been struggling with some simple code for a couple of days and ended up switching to getting the pixels of 2 bitmaps in int[] array just to compare certain areas of images. I can't get locateDifference to do it. Could someone tell me if my code is ok or not,
I can't understand why if I get the pixel data and compare the arrays (commented out code) I get correct results but locateDifference always tells me there equal.
/* this works pixs = new int[w*h];
bit22.getARGB(pixs, 0, w, offsetX, offsetY, w, h);
pixs2 = new int[w*h];
lastBitmap.getARGB(pixs2, 0, w, offsetX, offsetY, w, h);
b = ArrayComparison(pixs, pixs2);
*/
rect2 = new XYRect(0,0,w,h);
bit22.locateDifference(rect2,lastBitmap, offsetX, offsetY);
}
if((rect2.x > 0) || (rect2.y > 0))
{
//never any difference
}
Solved! Go to Solution.
11-04-2012 06:29 PM
passing the correct arguments to XYRect constructor fixed my problem!
11-04-2012 07:41 PM
Excellent, can you mark this as solved then - instructions in Help Link near top of screen in you need them.