Bug 558 : PImage.save() method is not working with get()
Last modified: 2007-05-08 12:11




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
REAS
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2007-05-08 09:25
In 0124, when using PImage.save() without using createImage(), I expect
this error:

java.lang.RuntimeException: java.lang.RuntimeException: PImage.save()
requires an absolute path. Or you can use createImage() instead or pass
savePath() to save().

But, I'm getting the error even when using createImage(). Here's a minimal
example:

PImage img;

void setup() {
size(600, 400);
img = createImage(300, 180, RGB);
noLoop();
}

void draw() {
background(102);
img = get(120, 200, img.width, img.height);
img.save("snapshot-####.png");
}
Additional Comment #1 From fry 2007-05-08 12:11
fixed for 0125. get(x, y, w, h) just wasn't setting the parent properly.

in your example, createImage() does nothing because the image created is
cleared out when you say "img =" something else.