Results 1 to 2 of 2
Thread: How do I deal with this error
- 04-13-2012, 03:57 AM #1
Member
- Join Date
- Apr 2012
- Posts
- 1
- Rep Power
- 0
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?
import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.image.BufferedImage;
import java.text.*;
import java.util.*;
import java.util.List;
public class P3
{
public void copyButterfly()
{
String sourceFile =
FileChooser.getMediaPath("butterfly.jpg");
Picture sourcePicture = new Picture (sourceFile);
Pixel sourcePixel = null;
Pixel targetPixel = null;
//loop through the columns
for (int sourceX = 0, targetX = 0;
sourceX < sourcePicture.getWidth();
sourceX++, targetX++)
{
//loop through the rows
for (int sourceY = 0, targetY = 0;
sourceY < sourcePicture.getHeight();
sourceY++, targetY++)
{
//set the target pixel color to the source pixel color
sourcePixel = sourcePicture.getPixel(sourceX,sourceY);
targetPixel = this.getPixel(targetX,targetY);
targetPixel.setColor(sourcePixel.getColor());
}
}
return sourcePicture;
}
}
-
Re: How do I deal with this error
Similar Threads
-
How to deal with Arabic string in java
By mnoko in forum New To JavaReplies: 3Last Post: 04-28-2012, 01:28 PM -
Deal with Printer Authentication
By Namrata.Shah in forum Java ServletReplies: 0Last Post: 02-29-2012, 07:12 AM -
How do I deal with entries that don't exist
By Jossos in forum New To JavaReplies: 11Last Post: 01-05-2012, 02:34 AM -
How to best deal with large file uploads ?
By HeapSpace in forum Advanced JavaReplies: 36Last Post: 06-08-2011, 07:32 PM -
I need to be able to deal with functions like matlab
By romina in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:37 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks