problem drawing to off-screen buffer 'beginDraw() does not exist'
in
Programming Questions
•
3 years ago
hello
i am having a problem when trying to draw to an off-screen buffer and save as a .tiff. the code i am using is taken directly from the 'processing' book but am getting the error 'the function beginDraw() does not exist'
code:
- PGraphics big;
- int numWires = 3; //number of wires
- void setup() {
- smooth();
- noLoop();
- big = createGraphics(4000, 1000, JAVA2D);
- beginDraw();
- for (int i = 0; i < numWires; i++) {
- int lineSpace = 1000/numWires;
- int lineHeight = 100+(i*lineSpace)+int(random(-30, 30));
- wire(0, lineHeight, 4000, lineHeight, int(random(2, 80)));
- }
- big.endDraw();
- big.save("big.tiff");
- }
am new to processing and am probably doing something wrong, any help would be appreciated.
thanks
1
