抓取图像像素到int数组

代码
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;
}
原文地址:https://www.cnblogs.com/frostbelt/p/1766312.html