コード例 #1
0
ファイル: Picture.java プロジェクト: riedlblower/cs-046
 /**
  * Sets the color of a pixel.
  *
  * @param i the pixel index
  * @param color the new color for the pixel
  */
 public void setColorAt(int i, Color color) {
   if (image == null || i < 0 || i >= pixels()) {
     throw new IndexOutOfBoundsException("" + i);
   } else {
     setColorAt(i % image.getWidth(), i / image.getWidth(), color);
   }
 }