Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage s;
- void setup()
- {
- size(800, 800);
- s = loadImage("58282082_6123806342093_5453113237480407040_n.png.jpg");
- surface.setResizable(true);
- }
- void draw()
- {
- background(255);
- imageMode(CENTER);
- float scale = min(width / s.width, height / s.height);
- float sw = scale * s.width;
- float sh = scale * s.height;
- image(s, width/2, height/2, sw, sh);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement