I am working on a Quiz app and have made it working for normal questions that will be shown in my TextView. Further I require to show user an Image (probably find the difference between two images OR find letters hidden in image) and for that, user have to click on some area of the image.
How can I get the point where the user has clicked on the Image.
bool imagesAreEqual(Image i1, Image i2)
{
if (i1.getHeight() != i2.getHeight()) return false;
if (i1.getWidth() != i2.getWidth()) return false;
for (int y = 0; y < i1.getHeight(); ++y)
for (int x = 0; x < i1.getWidth(); ++x)
if (i1.getPixel(x, y) != i2.getPixel(x, y)) return false;
return true;
}
It compares each and every pixels and returns a boolean value whether they are equal.
Refer the below thread, compare two images in android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With