processing / processing-android-archive

96 stars 50 forks source link

Making a new PGraphics and displaying causes NullPointer #68

Open GKFX opened 10 years ago

GKFX commented 10 years ago

The simplest form of this is:

PGraphics pg = createGraphics(100, 100);
pg.background(100); //optional
image(pg, 0, 0);

To rectify it, you need to type:

PGraphics pg = createGraphics(100, 100);
pg.background(#ff0000); //optional
pg.loadPixels();
image(pg, 0, 0);
GKFX commented 10 years ago

Oddly, the second example didn't look right when background was 0;