I've got this piece of code that says that a certain method works when the width is larger than the height:
for (int i=0; i<=(width); i++) { int diagonalRow = height-1; for (int col=(width-height+i); col<width; col++) { int pixelColor= leftImage.getRGB(col,diagonalRow); img.setRGB(col, diagonalRow, pixelColor); diagonalRow--; } repaint(); try { Thread.sleep(10); } catch (InterruptedException e) { }; } } else { //Add code to consider image with larger height than width }
How do I make it to work the same way if the height is larger than the width using the else statement?