We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all,
I am getting an error while trying to resize an image in android mode. Whenever I call the image.resize() method I get given the following errors when installing and running the app on my device:
PImage img1;
setup(){
img1 = loadImage("img.png");
img1.resize(100, 100);
}
draw()
{
image(img1, width/2, height/2);
}
And the error I am getting is ():
FATAL EXCEPTION: Animation Thread java.lang.NullPointerException at android.graphics.Bitmap.checkPixelsAccess(Bitmap.java:1232) at android.graphics.Bitmap.setPixels(Bitmap.java:1294) at processing.core.PGraphicsAndroid2D.imageImpl(Unknown Source) at processing.core.PGraphics.image(Unknown Source) at processing.core.PApplet.image(Unknown Source) at processing.test.appname.appname.draw(appname.java:215) at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source) at processing.core.PApplet.run(Unknown Source) at java.lang.Thread.run(Thread.java:841)
Does anyone have any idea why I am getting this issue, when running in Java Mode the image resizes with no problems.
Thanks for the help,
Sean
P.S. sorry if I have formatted or asked the question the wrong way, this is my first time posting to the forums
Answers
try to insert loadPixels()
Awesome, thank you very much it worked like a charm :)