Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.net.*;
- import processing.video.*;
- Client c;
- String input;
- int incoming[];
- Capture video;
- PImage vi;
- void setup() {
- size(640, 480);
- video = new Capture(this, 640/2, 480/2);
- background(204);
- stroke(0);
- frameRate(5);
- c = new Client(this, "192.168.56.1", 12345);
- video.start();
- }
- void draw() {
- for (int i = 0; i < video.pixels.length; i++) {
- c.write(video.pixels[i]);
- }
- video.resize(80, 60);
- image(video, 40, 30);
- if (c.available() > 0) {
- for (int i = 0; i < incoming.length; i++) {
- incoming[i]=int(c.readString());
- vi.pixels[i] = incoming[i];
- }
- image(vi, 0, 0);
- }
- }
Add Comment
Please, Sign In to add comment