对于此类型的ERROR,方法未定义

-1 java methods blending undefined

您好我不断收到此错误:错误:方法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;
  }}
Run Code Online (Sandbox Code Playgroud)

Aja*_*y S 5

Java是区分大小写的语言.

所以无论你定义什么都要调用方法.

在你的情况下.

 pRef.blendRectWithWhite(0, 0, 300, 300, 2);
Run Code Online (Sandbox Code Playgroud)