public void shiftImageVertically(){ /*# YOUR CODE HERE */ this.redisplayImage(); for (int i = 0

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

public void shiftImageVertically(){ /*# YOUR CODE HERE */ this.redisplayImage(); for (int i = 0

Post by answerhappygod »

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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply