Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

G4P image toggle button being replaced

$
0
0

o/

Severe beginner question here:

I'm using G4P to create a second window. I have 3 GImageToggleButtons in that second window. During the sketch I scan a folder looking for incoming images and have a preview displayed above the toggles. Sometimes the incoming image preview replaces the off state of the toggle button.

I cant reproduce i consistently, sometimes it replaces the 2nd toggle, sometimes the third. Its not always the same image.

Thanks in advance.

Declared in setup()

btnToggle0 = new GImageToggleButton(controlWindow, 20, controlPanelSizeY-120, "GUI/btn.png", 2); btnToggle0.tag = "large screen button"; btnToggle1 = new GImageToggleButton(controlWindow, 100, controlPanelSizeY-120, "GUI/btn.png", 2); btnToggle1.tag = "small screen"; btnToggle2 = new GImageToggleButton(controlWindow, 180, controlPanelSizeY-120, "GUI/btn.png", 2); btnToggle2.tag = "face";

code that calls the preview image in the control window

if (getImage.endsWith("JPG")) { currentPreview = null; currentPreview = loadImage(getImage); currentPreview.resize(previewSizeX, previewSizeY); } } app.image(currentPreview, 20, 20);


Viewing all articles
Browse latest Browse all 2896

Trending Articles