Some trouble in exportation
in
Integration and Hardware
•
1 year ago
Hi,
I'm new here, so maybe this has been already explained before, but i didn't found it.
Sorry if it's the case. If it's not, could anyone explain me why it's not working ?
I tried to export my first processing stuff, as an applet, but it didn't work.
I couldn't read it on any browser.
I also exported it as an application (I'm working on mac).
It worked since I press Esc instead of closing the window (clicking or with the shortcut).
When I close it normaly (clicking for example). it corrupting my png file, so when i'm reopening it,
I got a blank new one (instead of having it has it was when I closed it)
I think there is something wrong about the way I'm saving it, or the way i'm lauching the png file.
If anyone could give me a hand on this it would really help me.
Thanks, and sorry again if it seems a really basic question
(also apologize for my engl, not my native language)
This is my code so far.
I'm new here, so maybe this has been already explained before, but i didn't found it.
Sorry if it's the case. If it's not, could anyone explain me why it's not working ?
I tried to export my first processing stuff, as an applet, but it didn't work.
I couldn't read it on any browser.
I also exported it as an application (I'm working on mac).
It worked since I press Esc instead of closing the window (clicking or with the shortcut).
When I close it normaly (clicking for example). it corrupting my png file, so when i'm reopening it,
I got a blank new one (instead of having it has it was when I closed it)
I think there is something wrong about the way I'm saving it, or the way i'm lauching the png file.
If anyone could give me a hand on this it would really help me.
Thanks, and sorry again if it seems a really basic question
(also apologize for my engl, not my native language)
This is my code so far.
- PImage b;
void setup () {
size (1000, 1000);
cursor(CROSS);
b = loadImage("draw.png");
tint(255, 70);
image(b, 0, 0);
}
void draw () {
if (mousePressed) {
fill (random(0, 50));
rect (mouseX, mouseY, random(1, 20), random(1, 20));
} else {
fill (255, 0);
noStroke ();
rect (mouseX, mouseY, random(1, 100), random(1, 100));
save("draw.png");
}
}
1