Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.