Losing Image button (cp5 GUI) after stand alone app creation + Image loading cause stand alone app fault
in
Integration and Hardware
•
1 year ago
Hi everybody,
I've just observe a strange phenomenon: after the stand alone app (mac os x) export, my GUI (created with cp5 GUI) lost every image used for button creation. Why? Someone can explain to me?
I've used this code to create some button inside "void setup{}":
- //Creating text rect and button
- fill(255);
- strokeWeight(1);
- rect(25,225,310,80,5);
- textSize(10);
- textAlign(LEFT);
- fill(0);
- text("Value measured by Press_sensor during test",27,318);
- // related Button
- cp5.addButton("PS", 0, 345, 245, 25, 25)
- .setImages(loadImage("blue.png"), loadImage("yellow.png"), loadImage("green.png"));
EDIT: after some test, I've observed the stand alone app doesn't run properly if I write inside "void setup{}" any load image call ("PImage img1;" PImage is call properly before the setup routine):
- // load image
- img1 = loadImage("logo.jpg");
- image(img1, 0, 0);
If i remove the load image call, everything goes right(except for the button image loading).
It is really strange!
1