We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
it seems that it's not possible to resize loaded image up in setup(). It works perfectly when I want to make image smaller. And resizing works fine inside draw() when using image(img, x, y, newWidthX, newHeightY) but it's not as good since it has to be resized each frame. Is there a reason why it shouldn't work and is there any workaround so I don't have to scale my image up all the time? It's quite useful for Android apps when I don't know target resolution. For example, I'm trying to make an adventure game test app and I want to resize lo-res background image to width/height of HD device... I'm new to Processing so I'm sorry if it's just some obvious stuff that I missed.
Have a good day, Martin
Answers
code please.
Did you resize before using the size method?
let's say that jpg or png is 480p
EDIT:
p5 1.5.1 osX as for me your code runs normally...
void draw() {
//image(layer1, 0, 0);// the same if you uncomment, it runs
//etc....
}
Thanks for your comments, guys.
Would you mind trying this test file so I know that we're really on the same page and that the problem is just on my side...
https://www.dropbox.com/s/rcf8x9gu4t5z1fw/resizeUp.zip?dl=1
I forgot to mention: I'm using Processing 2.0b7 / Snow Leopard and there's nothing down in console window when I run the sketch...when I tried to add P3D, P2D to the size(), i got this:
I tried it in APDE with the same results: resizing down works fine, but it's not possible to scale image over its original size.
@daremes:: tested: 1.5.1, works, 2.03 works....OSX 10.6.8 SN but the screenshot you posted reminds me that i have got exactly the same with another version (but which one???) for processing when using opengl or p3D...Try with 1.5.1 or 2.03b
"2.0b7"
Uh? Why use an old beta version? Not surprising you have errors...
Thank you very much, my fault, of course. It works on 2.0.3 (unfortunately, it seems that it's the last version compatible with 10.6.8.) @akenaton @PhilLho