您好,我一直收到此错误:错误:BlendablePic 类型的方法 BlendRectWithWhite(int, int, int, int, int) 未定义
这是我对两者的编码,当我查看其他论坛帖子时,我对该怎么做感到困惑,他们只是让我对该怎么做更加困惑!谢谢!
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;
}}