We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi guys, here it another question about porting Processing sketches on Android How can I use .jpg (or others file format) as background for my apps? I tried using
PImage wallpaper;
void setup() {
size(displayWidth, displayHeight, OPENGL);
smooth();
wallpaper = loadImage("wallpaper.png");
}
void draw() {
wallpaper.resize(width, height);
background(wallpaper);
}
In this way the maximum fps that I get is about 3 or 4... I tried even to load image with image(wallpaper, 0, 0, width, height) instead of background, but it recreate the image only every 5-6 seconds... in Processing and Mac app it works, but not on Android...
I tried the same in Eclipse but got same results (even activating hardware acceleration in the Manifest).
Thanks to all ;)
Answers
I have moved this from Arduino forum :)
Ehm... it is for Android, not Arduino :D
It maybe because of the call to resize in draw I suggest you put it in setup like this
That is why I moved it.
Nothing to do, I got 4 fps and stretched background image :\
Strange that the image is stretched, as it should have been resized in
setup()
. Try displaying the image withimage()
instead ofbackground()
.I already tried with image() instead of background, and it refresh the background image only every 4-5 seconds... I resolved, for now, using a generative background done in Processing, I think that it is more beautiful :D ... maybe it is some code issues, it is so chaotic... I will fix it