Does this not happen when you run it?
I have tried it with both Processing 1.5.1 and 2.04 and in both cases I get the image without the button.
Are you using G4P.draw() inside the draw() method?
If you do then the button face will be saved with the image and to avoid that you will have to take a slightly more complex approach show below.
In the following code we have a global variable called drawGUI which is initialised to 0 (zero). When you want to save the image then change this to 1, when the next frame is drawn the switch statement prevents the GUI being drawn and increments drawGUI to 2. In the next frame the GUI is still not drawn and the image is saved, finally resting drawGUI back to 0 so the GUI will be drawn in the next frame.
main tab
- import guicomponents.*;
- int drawGUI = 0;
- void setup() {
- size(480, 320);
- createGUI();
- customGUI();
- // Place your setup code here
- }
- void draw() {
- background(200, 220, 200);
- fill(255);
- rect(10, 10, width-20, height - 20);
- switch(drawGUI) {
- case 0:
- G4P.draw();
- break;
- case 1:
- drawGUI++;
- break;
- case 2:
- save("test.png");
- drawGUI = 0;
- }
- }
- // Use this method to add additional statements
- // to customise the GUI controls
- void customGUI() {
- }
gui tab
- void button1_Click1(GButton button) { //_CODE_:button1:436271:
- drawGUI = 1;
- } //_CODE_:button1:436271:
- // Create all the GUI controls.
- // autogenerated do not edit
- void createGUI() {
- G4P.setColorScheme(this, GCScheme.BLUE_SCHEME);
- G4P.messagesEnabled(false);
- button1 = new GButton(this, "Face text", 355, 244, 80, 30);
- button1.setTextAlign(GAlign.CENTER | GAlign.MIDDLE);
- button1.addEventHandler(this, "button1_Click1");
- }
- // Variable declarations
- // autogenerated do not edit
- GButton button1;
The code in both of my posts work - I get the image saved without the button. If you still can't get it to work you should post your code here.