Skip to content
This repository was archived by the owner on Aug 14, 2018. It is now read-only.

Making a new PGraphics and displaying causes NullPointer #68

Open
GKFX opened this issue May 31, 2014 · 1 comment
Open

Making a new PGraphics and displaying causes NullPointer #68

GKFX opened this issue May 31, 2014 · 1 comment

Comments

@GKFX
Copy link

GKFX commented May 31, 2014

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
Copy link
Author

GKFX commented May 31, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant