Re: using the getSubImage() method Please help?? Programming Software Development by l.worboyz … add the instance as you suggested in your reply? (myImage.getSubimage(x,y,w,h)) // otherwise, make and return the Rectangle… to compile this... error: cannot find symbol BufferedImage subImage = new getSubimage(x,y,w,h); error: cannot find symbol return BufferedImage; using the getSubImage() method Please help?? Programming Software Development by l.worboyz …;pass these four variables (x,y,w,h) into the getSubimage method of the original_image object." That method returns a… x = thisCol*w; int y = thisRow*h; ** BufferedImage subImage = new getSubImage(x, y, w, h); ** return BufferedImage; } ** This line of code… Re: using the getSubImage() method Please help?? Programming Software Development by JamesCherrill That looks 99% right! getSubimage (note capitals - Java is case-sensitive) is a method in the BufferedImage class, so you need an instance of BufferedImage to call it, eg `myImage.getSubimage(0, 0, 100, 100)` returns the top left 100x100 pixels of myImage as a new BufferedImage Re: using the getSubImage() method Please help?? Programming Software Development by JamesCherrill …'t exactly do what you need. When you call `original_image.getSubimage(x,y,w,h);` that creates a new BufferedImage containing… subimage. You need to use the sub image that the getSubimage() methods gives you. Your original code (lines 15,16) got… Re: using the getSubImage() method Please help?? Programming Software Development by l.worboyz Also i am unsure as to whether or not i am straying off the task at hand. The task i have to complete is as follows: "Pass these four variables into the 'getSubimage' method of the 'original_image' object. That method returns a BufferedImage, which you can directly return from your 'getImageRect' method". Re: using the getSubImage() method Please help?? Programming Software Development by l.worboyz Thanks for your support and help, you made things much clearer for me. I corrected the 2 lines as follows and, hey presto.... it compiles! :) original_image.getSubimage(x,y,w,h); return original_image; Re: using the getSubImage() method Please help?? Programming Software Development by JamesCherrill You are doing (trying to do) the right thing. You just need to get your syntax right on that one line. You are not calling a constructor, so the *new* keywod is wrong. It's jus a simple method call, like the example I gave you earlier. Keys not responding Programming Software Development by Viped … } } public BufferedImage getImg(int state) { if (state == 0) { return img.getSubimage(0, 0, 40, 20); } else if (state == 1) { return img… 0, 40, 20); } else if (state == 2) { return img.getSubimage(120, 0, 40, 20); } return null; } public void setImg(Image … Image Crop Programming Software Development by javalover … @Override public void actionPerformed(ActionEvent e) { //BufferedImage subim=im.getSubimage(x3-50, y3-30, w3, h3); BufferedImage subim=im….getSubimage(x3, y3, w3, h3); //System.out.println(x3+&… Re: Image Crop Programming Software Development by javalover … ActionListener() { @Override public void actionPerformed(ActionEvent e) { BufferedImage subim=im.getSubimage(x3, y3-30, w3, h3); JOptionPane.showMessageDialog(null, new JLabel… Operator && cannot be applied to boolean int Programming Software Development by ku95 … = block_width*i; int y = block_height*j; board[i][j] = original_image.getSubimage(x, y, block_width, block_height); } empty_row = NUM_ROWS-1; empty_col = NUM_COLUMNS-1… Spot the bug/glitch Programming Software Development by cwarn23 …==true) { img_btnzoomin=img_btn; BufferedImage dest = toBufferedImage(img_btn,false); dest = dest.getSubimage(7, 51, 22, 22); img_btnzoomin = Toolkit.getDefaultToolkit().createImage(dest.getSource… Re: Spot the bug/glitch Programming Software Development by cwarn23 …==true) { img_btnzoomin=img_btn; BufferedImage dest = toBufferedImage(img_btn,false); dest = dest.getSubimage(7, 51, 22, 22); img_btnzoomin = Toolkit.getDefaultToolkit().createImage(dest.getSource… create an image of a JFrame window Programming Software Development by nikolaos … hole screen? I don't want to use the bimage.getSubimage(WIDTH, WIDTH, width, width) method or to constantly calculate the… how to create a static array of ImageIcons Programming Software Development by deshazer.jad … been loading that file into a buffered image and using getSubImage() to break it up into multiple ImageIcons. I'd still… Active Tile not moving even though I am changing it's position Programming Software Development by Doogledude123 … < diff.getHeight(); j++) { tiles[i][j] = new Tile(image.getSubimage(i * tileWidth, j * tileHeight, tileWidth, tileHeight), diff, tileWidth, tileHeight); tiles… Adding Multiple BufferedImages to one BufferedImage (Optimization) Programming Software Development by Doogledude123 … you can render only a smaller portion of it (using `getSubImage()`) and only edit the image when it needs to. Here… Re: Displaying part of a larger image Programming Software Development by sirlink99 …) Toolkit.getDefaultToolkit().getImage("Images/image.png"); character = img.getSubimage ((32 * animationNumber), (32 * 4), 32, 32); animationNumber ++; if…) Toolkit.getDefaultToolkit().getImage("Images/image.png"); character = img.getSubimage ((32 * animationNumber), (32 * 1), 32, 32); animationNumber ++; … Re: Displaying part of a larger image Programming Software Development by sirlink99 ….read(new File ("Images/image.png")); character = img.getSubimage ((32 * animationNumber), (32 * 4), 32, 32); animationNumber ++; } catch (IOException ….read(new File ("Images/image.png")); character = img.getSubimage ((32 * animationNumber), (32 * 1), 32, 32); animationNumber ++; } catch (IOException … Re: Displaying part of a larger image Programming Software Development by sirlink99 ….read(new File ("Images/image.png")); character = img.getSubimage ((32 * animationNumber), (32 * 4), 32, 32); animationNumber ++; try { Thread.….read(new File ("Images/image.png")); character = img.getSubimage ((32 * animationNumber), (32 * 1), 32, 32); animationNumber ++; } catch (IOException … Re: Displaying part of a larger image Programming Software Development by sirlink99 …(32 * 3) + ", " + 32 + ", " + 32); character = img.getSubimage ((32 * (animationNumber-1)), (32 * 3), 32, 32); animationNumber ++; try { System….read(new File ("Images/image.png")); character = img.getSubimage ((32 * (animationNumber-1)), (32 * 0), 32, 32); animationNumber ++; } … Re: Displaying part of a larger image Programming Software Development by sirlink99 …) Toolkit.getDefaultToolkit().getImage("Images/image.png"); character = img.getSubimage ((32 * animationNumber), (32 * 4), 32, 32); animationNumber ++; if…) Toolkit.getDefaultToolkit().getImage("Images/image.png"); character = img.getSubimage ((32 * animationNumber), (32 * 1), 32, 32); animationNumber ++; … Re: Separate KeyListener Programming Software Development by sirlink99 ….read(new File ("Images/image.png")); character = img.getSubimage((animationNumber * 32), 96, 32, 32); animationNumber ++; if (animationNumber == 3….read(new File ("Images/image.png")); character = img.getSubimage((animationNumber * 32), 32, 32, 32); animationNumber ++; if (animationNumber == 3… Re: Find the differences between two images and the locations of the differences Programming Software Development by Clawsy … cell images from the big image no? Something like 'image.getSubimage(x1,y1,w,h);' and then send it. I done…;> 3); x++) { if(cellChanged[x][y]){ BufferedImage cellImg = img.getSubimage(x,y,8,8); //here I send this cell to… Re: Displaying part of a larger image Programming Software Development by NormR1 [QUOTE]RasterFormatException: (y + height) is outside of Raster ... at java.awt.image.BufferedImage.getSubimage(Unknown Source) at Animation.run(Animation.java:40)[/QUOTE] Print out the values used in the getSubimage method to see if they are within the image. Re: Splitting an image into blocks? Programming Software Development by JamesCherrill Don't know why that didn't work, but why not just use [icode]getSubimage(int x, int y, int w, int h)[/icode] to create your array of sub-images directly? Re: Find the differences between two images and the locations of the differences Programming Software Development by JamesCherrill Where's the slowdown - is it in the getSubImage or in the sending? - because if it's in the … Re: Process Grayscale Image Programming Software Development by takercena ….read( new File( "c:\\lena512.jpg" ) ); bimg = bimg.getSubimage(0, 0, 512, 512); //Access it's pixel int w… Re: Displaying part of a larger image Programming Software Development by sirlink99 …) Toolkit.getDefaultToolkit().getImage("Images/image.png"); character = img.getSubimage ((32 * 2), (32 * 4), 32, 32); System.out.println (character… Re: Displaying part of a larger image Programming Software Development by Ezzaral …) Toolkit.getDefaultToolkit().getImage("Images/image.png"); character = img.getSubimage ((32 * animationNumber), (32 * [COLOR="Red"]offset[/COLOR]), 32…