代码
int w=im.getWidth(this);
int h=im.getHeight(this);
int[] pixels=new int[w*h];
public int[] Image2intAarry(Image im){
try{
PixelGrabber pg=new PixelGrabber(im,0,0,w,h,pixels,0,w);
pg.grabPixels();
}catch(InterruptedException e){
e.printStackTrace();
}
return pixels;
}