We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all!
I'm new to processing and trying to scale image using Mouse wheel. Basically, I get the value of e, but it doesn't seem to be global variable so draw function cannot use it to scale image. Please help me to solve this problem!
PImage img; float e = 0.0;
void setup() { size (500, 500); img =loadImage ("img.png"); frameRate (24); }
void mouseWheel(MouseEvent event) { float e = event.getAmount(); println(e); }
void draw () { background (255); translate (0, 0); scale (e); image(img, 50, 50); }
Answers
I make something quick like that, I think you need a var to record your scale before use
Thanks a lot! :)