exported PGraphic stays black
in
Programming Questions
•
2 years ago
Why does the exported PGraphic stays black?
(it's not the shape i draw on it, if i excludethat then still the same shit).
(it's not the shape i draw on it, if i excludethat then still the same shit).
- ExcludeArea ex;
void setup() {
size(1000, 1000);
ex = new ExcludeArea(width, height, "star.svg");
exit();
}
class ExcludeArea {
int width, height;
PShape excludeShape;
PGraphics excludeCheckArea;
ExcludeArea(int width, int height, String excludeShape) {
this.width = width;
this.height = height;
this.excludeShape = loadShape("star.svg");
excludeCheckArea = createGraphics(width, height, P2D);
createExcludeArea();
}
void createExcludeArea() {
colorMode(RGB, 255, 255, 255);
excludeCheckArea.beginDraw();
excludeCheckArea.colorMode(RGB, 255, 255, 255);
excludeCheckArea.background(100);
excludeCheckArea.shape(excludeShape, 0, 0);
excludeCheckArea.fill(100, 0, 0);
excludeCheckArea.rect(0, 0, width/2, height/2);
excludeCheckArea.endDraw();
excludeCheckArea.save("excludeCheckArea.jpg");
}
}
1