We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Illegal Argument?
Page Index Toggle Pages: 1
Illegal Argument?? (Read 544 times)
Illegal Argument??
Oct 5th, 2006, 7:49pm
 
I am getting the following error message when I try to run my app. This has happen since I added the following code to the draw() function

Gold_Frame = (Gold_Frame + 1) % GoldMoveRight;
image (Gold_Vinyl[Gold_Frame], Gold_VinylX + BackgroundX, Gold_VinylY);

Is this something I have done or could this be a potential bug?

Thanks

2006-10-05 18:40:20.649 java[187] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x10703, name = 'java.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2006-10-05 18:40:20.650 java[187] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)

java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.
java:999)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:326)
at processing.core.PGraphicsJava2D$ImageCache.<init>(PGraphicsJava2D.java:630)
at processing.core.PGraphicsJava2D.imageImpl(PGraphicsJava2D.java:577)
at processing.core.PGraphics.image(PGraphics.java:1997)
at processing.core.PApplet.image(PApplet.java:7074)
at Temporary_8300_8883$Spinning_Gold.Spinning_Gold_Record(Temporary_8300_8883.java:
2550)
at Temporary_8300_8883.Background(Temporary_8300_8883.java:719)
at Temporary_8300_8883.draw(Temporary_8300_8883.java:592)
at processing.core.PApplet.handleDisplay(PApplet.java:1311)
at processing.core.PGraphics.requestDisplay(PGraphics.java:568)
at processing.core.PApplet.run(PApplet.java:1406)
at java.lang.Thread.run(Thread.java:613)
Re: Illegal Argument??
Reply #1 - Oct 5th, 2006, 8:17pm
 
are you sure the image you were drawing was loaded properly and that it wasn't null?
Re: Illegal Argument??
Reply #2 - Oct 5th, 2006, 8:30pm
 
I'm assuming so. I have a function called:

Load_Gold_Vinyl_Images();

that I call in setup.

The function is as follows:

void Load_Gold_Vinyl_Images()
{
Gold_Vinyl[0] = loadImage("Gold_Vinyl_1.png");
..... up to
Gold_Vinyl[19] = loadImage("Gold_Vinyl_1.png");
}

I get no error messages if I run this function without the:

Gold_Frame = (Gold_Frame + 1) % GoldMoveRight;
image (Gold_Vinyl[Gold_Frame], Gold_VinylX + BackgroundX, Gold_VinylY);

It is only when this code is present in draw() that I get the error messages. It is strange because I do have basically the same function being called for Silver vinyls and that runs with absolutely no problems. (with the appropriate variables of course).

Thanks

Andy
Re: Illegal Argument??
Reply #3 - Oct 5th, 2006, 10:31pm
 
It seems that one of my files had become corrupt and although it would load it wouldn't display. Fixing the file has fixed the problem.

Thanks
Page Index Toggle Pages: 1