-1

こんにちは、私はこのエラーを受け取り続けています: エラー: メソッド BlendRectWithWhite(int, int, int, int, int) は、型 BlendablePic に対して未定義です

これが両方のコーディングです。他のフォーラムの投稿を見て、何をすべきかについて混乱しています。ありがとう!

import java.awt.Color;
public class IHateCompScience 
{
 public static void main(String[] args)

{
FileChooser.pickMediaPath();
BlendablePic pRef = new BlendablePic(FileChooser.pickAFile());
pRef.BlendRectWithWhite(0, 0, 300, 300, 2);
pRef.explore();

}}

public class BlendablePic extends Picture{
 public BlendablePic(String filename){
super(filename);
 }
 public void blendRectWithWhite(int xMin, int yMin, int xMax, int yMax, double a)
 {
 int x;
 x = xMin;
 while (x<= xMax)
 {
  int y;
  y = yMin;
  while(y <= yMax)
  {
    Pixel refPix = this.getPixel(x,y);
    refPix.setRed((int)Math.round(refPix.getRed() * (1.0 +a)+255*a));
    refPix.setGreen((int)Math.round(refPix.getGreen() * (1.0 +a)+255*a));
    refPix.setBlue((int)Math.round(refPix.getBlue() * (1.0 +a)+255*a));
  y= y+1;
  }
  x = x+1;
  }}
4

2 に答える 2

5

Java は大文字と小文字を区別する言語です。

したがって、定義したメソッドを呼び出します。

あなたの場合。

 pRef.blendRectWithWhite(0, 0, 300, 300, 2);
于 2013-03-29T17:05:21.057 に答える
1
pRef.BlendRectWithWhite(0, 0, 300, 300, 2);

する必要があります

pRef.blendRectWithWhite(0, 0, 300, 300, 2);
于 2013-03-29T17:05:52.670 に答える