Results 1 to 2 of 2
- 11-01-2009, 04:05 PM #1
Getting error....picture scaleUp method
public Picture scaleUp(int numTimes)
{
Picture targetPicture = new Picture(this.getWidth()*numTimes, this.getHeight()*numTimes);
Pixel sourcePixel = null;
Pixel targetPixel = null;
int targetX = 0;
int targetY = 0;
for(int sourceX = 0; sourceX < this.getWidth(); sourceX++)
{
for(int sourceY = 0; sourceY < this.getHeight(); sourceY++)
{
sourcePixel = this.getPixel(sourceX,sourceY);
for(int indexY = 0; indexY < numTimes(); indexY++)
{
for(int indexX = 0; indexX < numTimes(); indexX++)
{
targetX = sourceX * numTimes + indexX;
targetY = sourceY * numTimes + indexY;
targetPixel = targetPicture.getPixel(targetX, targetY);
targetPixel.setColor(sourcePixel.getColor());
}
}
}
}
return targetPicture;
}
Errors
File: C:\intro-prog-java\bookClasses\Picture.java [line: 97]
Error: cannot find symbol
symbol : method numTimes()
location: class Picture
File: C:\intro-prog-java\bookClasses\Picture.java [line: 99]
Error: cannot find symbol
symbol : method numTimes()
location: class Picture
- 11-01-2009, 04:17 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,382
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Non-static method error
By Lingerz in forum New To JavaReplies: 1Last Post: 09-21-2009, 04:56 PM -
an error in paint method
By hopey in forum Java 2DReplies: 7Last Post: 04-24-2009, 10:12 PM -
static method sparks error on overriding non-static method
By MuslimCoder in forum New To JavaReplies: 1Last Post: 02-10-2009, 10:03 AM -
Error with getString() method in
By trivektor in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 11-14-2008, 06:30 PM -
Error With Simply Displaying Picture
By JDCAce in forum Java AppletsReplies: 4Last Post: 10-07-2008, 08:09 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks