public static int[] getPixels(Image img, int x, int y, int w, int h) {
int[] pixels = new int[w * h]; // PixelGrabber does the work of getting
// actual RGB pixel values for // us from
// the image.
PixelGrabber pg = new PixelGrabber(img, x, y, w, h, pixels, 0, w);
try {
pg.grabPixels();
} catch (InterruptedException e) {
System.err.println("interrupted waiting for pixels!");
}
if ((pg.getStatus() & ImageObserver.ABORT) != 0) {
System.err.println("image fetch aborted or errored");
}
return pixels;
}
TabUtilities.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:myster
作者:
评论列表
文章目录