Hi there, I'm new to processing and am trying to create a canvas in which you can edit and enhance a given image (roughly) using the draw Stroke tool and then save it at the end.
I've set up the scene so that there is my image on a background and I can draw on it. But I'd like there to be a button to change the Stroke colour from black to say, grey or any colour to be honest.
I was thinking I could just create a button and add a variable called colour and then 'on click' .push a value into the variable array like in Javascript. But I can't do it :/
Any suggestions would be absolutely great - I'd really appreciate it. Thankyou very much
This is the code I have to draw my character etc -
- PImage img;
- void setup() {
- size(600,600);
- background(#FF9999);
- // Make a new instance of a PImage by loading an image file
- img = loadImage("forprocessing.png");
- image(img,0,0);
- }
- void draw() {
- // Draw the image to the screen at coordinate (0,0)
- stroke(0);
- strokeWeight(2);
- smooth();
- // Draw if mouse is pressed
- if (mousePressed) {
- line(pmouseX, pmouseY, mouseX, mouseY);
- }
- }
1