New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when using image() created with createGraphics(PGraphicsRetina2D) #2510

Closed
jiehanzheng opened this Issue May 13, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@jiehanzheng

jiehanzheng commented May 13, 2014

Can be reproduced with the following in Processing 2.2:

void setup() {
  size(100, 100, "processing.core.PGraphicsRetina2D");
  PGraphics pg = createGraphics(100, 100, "processing.core.PGraphicsRetina2D");
  pg.beginDraw();
  pg.endDraw();
  image(pg, 0, 0); 
}

I am on a 13-inch Retina MacBook Pro (Early 2013).

@benfry benfry changed the title from NullPointerException in image() with PGraphicsRetina2D to NullPointerException when using image() created with createGraphics(PGraphicsRetina2D) May 14, 2014

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jun 16, 2015

Member

Now working in 3.0a10. Updated for the 3.0 API changes:

void setup() {
  size(100, 100);
  pixelDensity(2);
  PGraphics pg = createGraphics(100, 100);
  pg.beginDraw();
  pg.endDraw();
  image(pg, 0, 0);
  println(pg.pixelWidth);  // make sure this says 200
}
Member

benfry commented Jun 16, 2015

Now working in 3.0a10. Updated for the 3.0 API changes:

void setup() {
  size(100, 100);
  pixelDensity(2);
  PGraphics pg = createGraphics(100, 100);
  pg.beginDraw();
  pg.endDraw();
  image(pg, 0, 0);
  println(pg.pixelWidth);  // make sure this says 200
}

@benfry benfry closed this Jun 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment