Processing java mode code a slideshow with image effect

preview_player
Показать описание
This video shows you how to code a nice slideshow with image effect and with processing
Рекомендации по теме
Комментарии
Автор

Hello this is really nice
But can you tell how to convert this slide show in mp4 or gif and store in directory

pavanrajput
Автор

// hello i am going to show you how to code a nice slideshow

int N_IMAGES = 5;
int current_image = 0;
int next_image = 1;

PImage[] my_images;

Slideshow my_slideshow;

void setup() {

size(displayWidth, displayHeight, P3D);

// put 5 images in the data's folder and rename them like this
// my_images0.jpg my_images1.jpg my_images2.jpg my_images3.jpg my_images4.jpg

my_images = new PImage[N_IMAGES];

for (int i = 0; i < N_IMAGES; i++) {
my_images[i] = loadImage("my_images" + str(i) + ".jpg");
// resize the images
my_images[i].resize(600, 400);
}

my_slideshow = new Slideshow();
}

void draw() {

// color blue
background(0, 90, 200);



}

class Slideshow {

private int[] count;

private float next_image_x, next_image_y, next_image_z;

private float[] x, y, z;
private float[] degrees_x, degrees_y, degrees_z;

Slideshow() {

count = new int[N_IMAGES];

x = new float[N_IMAGES];
y = new float[N_IMAGES];
z = new float[N_IMAGES];

degrees_x = new float[N_IMAGES];
degrees_y = new float[N_IMAGES];
degrees_z = new float[N_IMAGES];

initialize_the_parameters();
}

void initialize_the_parameters() {

next_image_x = 350.0;
next_image_y = 300.0;
next_image_z = 0.0;

for (int i = 0; i < N_IMAGES; i++) {

count[i] = 0;

x[i] = next_image_x;
y[i] = next_image_y;
z[i] = next_image_z;

degrees_x[i] = 0.0;
degrees_y[i] = 0.0;
degrees_z[i] = 0.0;
}
}

void move_the_image() {

count[ current_image ]++;

if (count[ current_image ] < 50) {
// do nothing just displays the images few seconds
} else if ( count[ current_image ] > 50 && count[ current_image ] < 100) {
degrees_x[ current_image ] += 6.0;
} else if ( count[ current_image ] == 200) {

current_image++;
current_image %= N_IMAGES;

next_image = (current_image + 1 < N_IMAGES) ? current_image + 1 : 0;

initialize_the_parameters();
}
}

void display_the_image() {

// next image
pushMatrix();

translate(next_image_x, next_image_y, next_image_z);

image(my_images[ next_image ], 0, 0);

popMatrix();

// current image
pushMatrix();

translate(x[ current_image ], y[ current_image ], z[ current_image ]);

rotateX( radians( degrees_x[ current_image ] ) );

image( my_images[ current_image ], 0, 0);

popMatrix();
}
}

coprocessingcoprocessing
Автор

How can I display image on a Plabel or Glabel from a database or from a file ? thank you

loveworld
Автор

If I want to make a button in which if I click it passes the image, how should I do? can you help me please?

djyazoow
visit shbcf.ru