How do I deal with this error
My goal is to try to make 6 copies of this one picture. However, I am running into this error....
Cannot find symbol
symbol : method getPixel (int,int)
Do you have any suggestions for how I can change this .this to make it compile?
public class P3
public void copyButterfly()
String sourceFile =
Picture sourcePicture = new Picture (sourceFile);
Pixel sourcePixel = null;
Pixel targetPixel = null;
//loop through the columns
for (int sourceX = 0, targetX = 0;
sourceX < sourcePicture.getWidth();
//loop through the rows
for (int sourceY = 0, targetY = 0;
sourceY < sourcePicture.getHeight();
//set the target pixel color to the source pixel color
sourcePixel = sourcePicture.getPixel(sourceX,sourceY);
targetPixel = this.getPixel(targetX,targetY);
Re: How do I deal with this error
The error message is pretty straight-forward. The class Picture does not have a method getPixel(...) that takes two int parameters. So you'll have to look at the API for the Picture class to see just what public methods you may use.
Originally Posted by Publiccarbus