joedusso
YaBB Newbies
Offline
Posts: 2
Arrayindexoutofbounds //HELP ME PLEASE!
Feb 4th , 2010, 1:21am
I am new to processing and have been working on this program for a school project. The due date has past and I am desperate. Any help would be greatly appreciated. Here is the code. //Joseph Dusseault //import a background image //Important quicktime movie , loop it, and draw //using it. Press the mouse button and a PDF file of your drawing //will be saved //this program can serve many different purposes, it makes availible //a way in which to portray video in a new and exciting manner. //For example, if a person had a video clip of themselves in a basletball game //or giving a speech, they coult create a representation of that event within //this program that could then be used for a keep sake, an advertisement, or //any number of other things. import processing.video.*;//command to play quicktime video Movie myMovie; void setup() { import processing.pdf.*;//creates a pdf file representing the application //window { size(1000, 850);//size of window and pdf beginRecord(PDF, "everything.pdf");//PDF file is created, lable it as //you wish } PImage b;//load image // Images must be in the "data" directory to load correctly b = loadImage("Project-1bck-grd-img.jpg");//select background image image(b, 0, 0); // Load and play the video in a loop, must be in "data" directory myMovie = new Movie(this, "8x-quicktime-#1.mov");//select quicktime movie myMovie.loop(); } void movieEvent(Movie myMovie) { myMovie.read(); } //this function is what enables you to draw using the movie being played void draw() { tint(255, 20); image(myMovie, mouseX-myMovie.width/2, mouseY-myMovie.height/2);//THE PROBLEM SEEMS TO BE HERE! ON CODE ABOVE } //tell the program to capture PDF, close the program, and save PDF void mousePressed() { endRecord(); exit(); } //sometimes the program experiences an error. //when this happens, try moving the window to a different location //on the screen while it is running,then //stop running the program and try again ArrayindexOutOfBoundsException: Coordinates out of bounds! Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds! at sun.awt.image.IntegerInterleavedRaster.setDataElements(IntegerInterleavedRaster. java:404) at processing.core.PGraphicsJava2D$ImageCache.update(PGraphicsJava2D.java:922) at processing.core.PGraphicsJava2D.imageImpl(PGraphicsJava2D.java:809) at processing.core.PGraphics.image(PGraphics.java:2182) at processing.core.PApplet.image(PApplet.java:7279) at Project_1.draw(Project_1.java:68) at processing.core.PApplet.handleDraw(PApplet.java:1425) at processing.core.PApplet.run(PApplet.java:1327) at java.lang.Thread.run(Thread.java:619)