Loading a line pixels from each picture in an array.

edited November 2016 in Questions about Code

We are trying to have an array of images displayed a once but in a way that you just see one line of pixels from each images in the array. so that pic 1 = line 0 in the image and uses the first line of pixels in the images and so on.

we have tried to solve with for loops but we are quiet new to processing and i think there is a general mistake in our understanding of for loops.

cheers

// PImage [] schrank= new PImage [16]; int y =0; //final int DISPLAY_TIME=40; int lastTime; int dir = 1; int []line=new int [600];

void setup() { size(567,360);

// if (millis() - lastTime >= DISPLAY_TIME) {
for (int i = 0; i < schrank.length; i++)

{ schrank[i] = loadImage("schrank" + nf(i+1, 2) + ".jpg"); // nf() allows to generate 01, 02, etc. }

} void draw(){

for (int i = 0; i < schrank.length; i++) { for (int line = 0; line < height ; line++){ copy(schrank[i],0,1, width,1,0,1, width,1+line);

   }

} // lastTime = millis(); }

//

Tagged:

Answers

Sign In or Register to comment.