抓取图像像素到int数组

 

抓取图像像素到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;
}

 

 

 

你可能感兴趣的:(int)