Making image background in Eclipse
in
Programming Questions
•
8 months ago
Hi guys,
I'm new to Processing , and am still fumbling around with the various functions. Can someone tell me how the resize function in PImage works ?? I cannot seem to get it to resize my image for setting in the background !? Here is the code
public class tutorial1 extends PApplet
{
//laod an instance of PImage
PImage img;
public void setup()
{
size(400, 400);
//populate an instance of PIMage
img= loadImage("Conn4Board.jpg");
img.resize(400, 400);
}
public void draw()
{
background(img);
//draw an image on the screen at coordinates 0
//image (img, 0, 0);
}
}
I have tried assigning "img.resize(400, 400);" to a new variable img2 but no joy ? I know that if I put
"image (img, 0, 0, 400, 400 );" It'll fit, but I would like to know what part of the img.resize I am doing wrong :/
I would appreciate anyones insight on this
Thanks
Steve.
1