Processing Error Coordinate Out Of Bounds
Tool DevelopmentEvents and OpportunitiesGeneral Discussion Sub forum : Move this topic Cancel Core Library Questions coloresque Weird problem (coordinates out of bounds) in Core Library Questions • 2 years ago I just took the movie sample code from the Processing website, and when I want to run it using my own movie (for which I also changed the height and width of the canvas, it gives me the error: ArrayIndexOutOfBoundsException: Coordinate out of bounds! What could possibly be wrong? import processing.video.*; Movie theMov; void setup() { size(640, 380); theMov = new Movie(this, "bird.mov"); theMov.play(); /* only use 1 of the following options */ //theMov.play(); //plays the movie once //theMov.loop(); //plays the movie over and over } void draw() { image(theMov, 0, 0); } void movieEvent(Movie m) { m.read(); } 2 Replies(2) dakkumar Re: Weird problem (coordinates out of bounds) 2 years ago I am using code on pp. 82-83 of Joshua Noble's "Programming Interactivity". I get this error: "ArrayIndexOutOfBoundsException: Coordinate out of bounds!" My video clip is of size 320x240. It's called "clip.mov" and has been placed in a folder called "data" inside the folder that contains the .pde file. Here is the code, and it is exactly as in "Programming Interactivity" but for the addition of the line that says: "frameRate(15);". I get the same error even without this line. import processing.video.*; Movie mov; void setup() { size(320, 240); frameRate(15); mov = new Movie(this, "clip.mov"); mov.play(); } void movieEvent(Movie m) { m.read(); } void draw() { image(mov,0,0); } Please help! dakkumar Re: Re: Weird problem (coordinates out of bounds) 2 years ago See answer from Brian Jepson at http://getsatisfaction.com/oreilly/topics/movie_clip_coordinate_out_of_bounds_error_wont_play . Leave a comment on dakkumar's reply Change topic type Topic Type : Discussions Questions No of days : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Change topic type Cancel Link this topic Provide the permalink of a topic that is related to this topic Permalink Save Close Reply to coloresque's question Top Reply {"z6121797":[25080000000870120,25080000000869251],"z5618368":[25080000000765284]} Statistics 2Replies 1851 Views 1Followers Tags No tags available for this topic. Cancel Actions Permalink Related Posts Why can't I play more than one ... Making a game using webcam and brig... OpenGL triangle not rendering OutOfMemoryError when playing sever... Buzzing noise and buffer underrun i...
Tool DevelopmentEvents and OpportunitiesGeneral Discussion Sub forum : Move this topic Cancel Programming Questions estwheadn ArrayOutOfBoundsException: Coordinate out of bounds! in Programming Questions • 2 years ago I'm creating my first game and it's been going well so far, but then I ran into this error. Ok so my window is 1024x768. I am getting this exception: "ArrayOutOfBoundsException: Coordinate out of bounds!" here the method where the exception happens: public void drawHealthBars(){ PImage purpleHealthBar = loadImage("purpleHealthBar.jpg"); //this size of this image is 1x50 pixels PImage greenHealthBar = loadImage("greenHealthbar.jpg"); //this size of https://forum.processing.org/topic/weird-problem-coordinates-out-of-bounds this image is 1x50 pixels int cHealth1 = model.player[0].getCurrentHealth(); //this value is 100 int tHealth1 = model.player[0].getTotalHealth(); //this value is 100 int cHealth2 = model.player[1].getCurrentHealth(); //this value is 100 int tHealth2 = model.player[1].getTotalHealth(); https://forum.processing.org/topic/arrayoutofboundsexception-coordinate-out-of-bounds //this value is 100 int numBars1, numBars2; if(cHealth1 > tHealth1/2) numBars1 = 2; else if (cHealth1 > 0) numBars1 = 1; else numBars1 = 0; if(cHealth2 > tHealth2/2) numBars2 = 2; else if (cHealth2 > 0) numBars2 = 1; else numBars2 = 0; if(numBars1 == 2){ float barSize = (float)(cHealth1-tHealth1/2) / (float)(tHealth1/2)*450; greenHealthBar.resize((int)barSize, 50); purpleHealthBar.resize(450, 50); image(purpleHealthBar, 25, 25); image(greenHealthBar, 25, 25); } else if(numBars1 == 1){ float barSize = (float)(cHealth1) / (float)(tHealth1/2)*450; fill(100); rectMode(CORNER); rect(25, 25, 450, 50); purpleHealthBar.resize((int)barSize, 50); image(purpleHealthBar, 25, 25); } if(numBars2 == 2){ float barSize = (float)(cHealth2-tHealth2/2) / (float)(tHealth2/2)*450; greenHealthBar.resize((int)barSize, 50); purpleHealthBar.resize(450, 50); image(purpleHealthBar, width -475, 25); println( width - (25+barSize)); image(greenHealthBar, width - (25 + barSize), 25); //THIS IS WHERE THE EXCEPTION OCCURS! } else if(numBars2 == 1){ float barSize = (float)(cHealth2) / (float)(tHealth2/2)*450; fill(100); rectMode(CORNER); rect(width-475, 25, 450, 50); purpleHealthBar.resize
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn http://stackoverflow.com/questions/22823681/how-do-i-fix-the-coordinates-out-of-bounds-error-in-my-code-in-java more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How do I fix the “Coordinates out of bounds” error in my code in Java? up vote 0 down vote favorite Here is what my code processing error looks like. I am getting an error that says "Exception in thread "main" java.lang.arrayIndexOutofBoundsException: Coordinate out of bounds!" I do not know what this means or how to fix it, so any help is greatly appreciated. import java.awt.Color; public class Assignment9 { /** * @param args * @return */ public static void removeBlue(Picture pic){ Color cPic = pic.get(100,100); //remove blue color pane from image, set blue weight to 0 int h = pic.height(); int w = pic.width(); processing error coordinate System.out.println(cPic); //^this shows the red, green, and blue weights int b = cPic.getBlue(); int r = cPic.getRed(); int g = cPic.getGreen(); System.out.println("r=" +r +"g="+g+"b="+b); pic.setColor(w, h, r, g, 0); for(int x=0; x