Flipping a picture 180 degrees
I made code so that I can copy a smaller picture into a bigger picture which is working but I need to add code to make it flip 180 degrees and I do not know how to go about that.
This is my code so far it picks up every pixel in the picture.
public void copyInto(int xWhere, int yWhere, Picture flower)
for(int x = 0; x < flower.getWidth(); x++)
for(int y = 0; y < flower.getHeight(); y++)
red = flower.getPixel(x,y).getRed();
green = flower.getPixel(x,y).getGreen();
blue = flower.getPixel(x,y).getBlue();
this.getPixel(xWhere + x, yWhere + y).setColor(new Color(red, green, blue) );
Re: Flipping a picture 180 degrees
Think about where the top left pixel is, and where it needs to go. Think about the next pixel and where it needs to go.
How will you get all of the pixels from where they are to where they need to go?