2 Replies - 840 Views - Last Post: 16 November 2012 - 12:59 PM Rate Topic: -----

#1 Tanyap  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-November 12

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

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)



Is This A Good Question/Topic? 0
  • +

Replies To: Working with Images - Processing

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9277
  • View blog
  • Posts: 34,785
  • Joined: 12-June 08

Re: Working with Images - Processing

Posted 16 November 2012 - 12:49 PM

What is the error? What is the language? *WHERE* is the error?
Was This Post Helpful? 0
  • +
  • -

#3 Tanyap  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-November 12

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)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1