public void shiftImageVertically(){ /*# YOUR CODE HERE */ this.redisplayImage(); for (int i = 0
Posted: Thu Jun 02, 2022 8:27 am
public void shiftImageVertically(){
/*# YOUR CODE HERE */
this.redisplayImage();
for (int i = 0; i <
this.image.length; i++) {
this.image =
this.image[this.image.length - 1 - i];
}
}
this code does run but does not perform the action intended,
instead of shifting the image down, it just flips half of the image
vertically. I tried playing around with it adding bunch of codes
but it didn't work. It is suppose to move the whole image down a
little bit, so each time it moves down by 1 pixel, another image
will appear at the top. Please help.
/*# YOUR CODE HERE */
this.redisplayImage();
for (int i = 0; i <
this.image.length; i++) {
this.image =
this.image[this.image.length - 1 - i];
}
}
this code does run but does not perform the action intended,
instead of shifting the image down, it just flips half of the image
vertically. I tried playing around with it adding bunch of codes
but it didn't work. It is suppose to move the whole image down a
little bit, so each time it moves down by 1 pixel, another image
will appear at the top. Please help.