Guest User

Untitled

a guest
Jun 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public void zoomImage(){
  2. // YOUR CODE HERE
  3. int height = this.image.length;
  4. int width = this.image[0].length;
  5. int halfwidth = (int) (width/2);
  6. int halfheight = (int) (height/3);
  7. for(int i = halfheight; i>=0; i--){
  8. System.out.println("i made it through the first for loop");
  9. if (height>=0){
  10. System.out.println("i made it heigh>0");
  11. for(int a = halfwidth; a>=0; a--){
  12. System.out.println("i made it in the 2nd for loop");
  13. if(width>=0){
  14. System.out.println("i made it into the loop :)");
  15. this.image[height][width] = this.image[i][a];
  16. this.image[height][width-1] = this.image[i][a];
  17. this.image[height-1][width] = this.image[i][a];
  18. this.image[height-1][width-1] = this.image[i][a];
  19. width = width-2;
  20. }
  21. }
  22. }
  23.  
  24. height = height-2;
  25. }
  26. this.redisplayImage();
  27. }
Add Comment
Please, Sign In to add comment