Advertisement
Guest User

Untitled

a guest
May 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. PImage s;
  2.  
  3. void setup()
  4. {
  5. size(800, 800);
  6.  
  7. s = loadImage("58282082_6123806342093_5453113237480407040_n.png.jpg");
  8.  
  9. surface.setResizable(true);
  10. }
  11.  
  12. void draw()
  13. {
  14. background(255);
  15. imageMode(CENTER);
  16. float scale = min(width / s.width, height / s.height);
  17. float sw = scale * s.width;
  18. float sh = scale * s.height;
  19.  
  20. image(s, width/2, height/2, sw, sh);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement