Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to know how to increase the size of my buffered image to the left and up, not just the right and down.

bI = new BufferedImage(yMax*size*5, xMax*size*5, BufferedImage.TYPE_INT_RGB);
share|improve this question

The "direction" of expansion would only matter if you already had data contained in the buffer. If you have a buffered image already, then want to make a larger one, you'll need to copy the data into the new larger buffer. When you copy the data into the new buffer you simply place the existing data at the bottom right corner. Like this:

enter image description here

Where x,y are the width,height of the old buffer and x2,y2 are the width,height of the new buffer.

So copying the data in I would get the old buffered data with getRGB then place that in the new buffer with setRGB.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.