???????e???????д???Щ??????????????и???????FindPic???????????Χ??????????????????????????????λ?á?
?????????Java?????????????????????
????????????
????????????????A??(????????????B)??
?????????A????????????B???磬????B???????????A????????
?????????????????B?????????????????????????????????в???4?????????????2??????
??????????????????Χ???????????B?????????????????????????????????????????????2??????
???????????????????????BufferedImage??????????????RGB???????????£???BufferedImage????int??????飺
1     /**
2      * ????BufferedImage?????RGB????
3      * @param bfImage
4      * @return
5      */
6     public static int[][] getImageGRB(BufferedImage bfImage) {
7         int width = bfImage.getWidth();
8         int height = bfImage.getHeight();
9         int[][] result = new int[height][width];
10         for (int h = 0; h < height; h++) {
11             for (int w = 0; w < width; w++) {
12                 //???getRGB(w?? h)?????????????ARGB????????????????????RGB???????????ARGB?????RGB????bufImg.getRGB(w?? h) & 0xFFFFFF??
13                 result[h][w] = bfImage.getRGB(w?? h) & 0xFFFFFF;
14             }
15         }
16         return result;
17     }
?????????????????RGB??????????????????????????????==Ч?????????????????????????0???????????????RGB??????????????
???????渽????????java????
1 package com.jebysun.test.imagefind;
2
3 import java.awt.AWTException;
4 import java.awt.Rectangle;
5 import java.awt.Robot;
6 import java.awt.Toolkit;
7 import java.awt.image.BufferedImage;
8 import java.io.File;
9 import java.io.IOException;
10
11 import javax.imageio.ImageIO;
12 /**
13  * ?????????????
14  * @author Jeby Sun
15  * @date 2014-09-13
16  * @website http://www.jebysun.com
17  */
18 public class ImageFindDemo {
19
20     BufferedImage screenShotImage;    //??????
21     BufferedImage keyImage;           //?????????
22
23     int scrShotImgWidth;              //?????????
24     int scrShotImgHeight;             //?????????
25
26     int keyImgWidth;                  //????????????
27     int keyImgHeight;                 //????????????
28
29     int[][] screenShotImageRGBData;   //??????RGB????
30     int[][] keyImageRGBData;          //?????????RGB????
31
32     int[][][] findImgData;            //??????????????λ???????????????????
33
34