HashMap<Integer, PImage> imageMap = new HashMap<Integer, PImage>();
int currentImg = 1;// initially display image number 1
void setup () {
size(500, 500);
// load some images, and store them in the imageMap with numbers.
imageMap.put(1, loadImage("img.jpg"));
imageMap.put(2, loadImage("img2.jpg"));
imageMap.put(3, loadImage("pic1.jpg"));
}
void draw() {
background(0);
image(imageMap.get(currentImg), 0, 0,0);
}
void keyPressed() {
if (key =='1') {
currentImg=1;
}
if (key =='2') {
currentImg=2;
}
if (key =='3') {
currentImg=3;
}
}
Error : the method image(Pimage,float,float)in the type Papplet is not applicable for the arguments(Pimage,int,int,int)
Working with Images - Processing
Page 1 of 12 Replies - 595 Views - Last Post: 16 November 2012 - 12:59 PM
#1
Working with Images - Processing
Posted 16 November 2012 - 12:40 PM
Hi im trying to show images but im getting an error , i am new to processing . please help
Replies To: Working with Images - Processing
#2
Re: Working with Images - Processing
Posted 16 November 2012 - 12:49 PM
What is the error? What is the language? *WHERE* is the error?
#3
Re: Working with Images - Processing
Posted 16 November 2012 - 12:59 PM
its Processing Language
image(imageMap.get(currentImg), 0, 0,0); - thats the error
Error : the method image(Pimage,float,float)in the type Papplet is not applicable for the arguments(Pimage,int,int,int)
image(imageMap.get(currentImg), 0, 0,0); - thats the error
Error : the method image(Pimage,float,float)in the type Papplet is not applicable for the arguments(Pimage,int,int,int)
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote







|