【发布时间】:2014-03-21 16:19:38
【问题描述】:
有大小为200x100 的图像。但是,当我想使用
int c = image.getRGB(200, 100);
出现错误。
java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
我想问是不是像素宽度的问题。如果是,我该如何解决?
【问题讨论】:
标签: java image-processing colors
有大小为200x100 的图像。但是,当我想使用
int c = image.getRGB(200, 100);
出现错误。
java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
我想问是不是像素宽度的问题。如果是,我该如何解决?
【问题讨论】:
标签: java image-processing colors
数组是零索引的,使用:
int c = image.getRGB(199, 99);
【讨论】:
像素从零开始索引。 试试
int c = image.getRGB(199, 99);
【讨论】: