• Compare two images....?

    From peter.kariuki@nbo.samadc.org@21:1/5 to TheBigPJ on Mon Jan 15 00:45:06 2018
    On Tuesday, April 1, 2008 at 10:11:23 PM UTC+3, TheBigPJ wrote:
    Suggestions on the best (preferably easiest way) to compare two images (captured both from the desktop via java robot) ?

    The following code is the code I will be using to take the screen shot (currently it saves just to a file):

    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;

    class Screenshot{

    static public void main()
    {
    try
    {
    //Get the screen size
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Dimension screenSize = toolkit.getScreenSize();
    Rectangle rect = new
    Rectangle(0,0,screenSize.width,screenSize.height);
    Robot robot = new Robot();
    BufferedImage image = robot.createScreenCapture(rect);
    File file;

    //Save the screenshot as a png
    file = new File("screen.png");
    ImageIO.write(image, "png", file);

    //Save the screenshot as a jpg
    file = new File("screen.jpg");
    ImageIO.write(image, "jpg", file);
    }
    catch (Exception e)
    {
    System.out.println(e.getMessage());
    }
    }
    }


    Thank you,
    Peter (thebigpj)

    https://photos.google.com/u/1/photo/AF1QipO13vU8-ye2z6EpePeG291YDp7MMupEVxl6rs9V

    https://photos.google.com/u/1/photo/AF1QipPplix9mZCFzWdOl7GJiZWjrid2qcKxlagwluzY

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)