Rockst4r
YaBB Newbies
Offline
Posts: 6
.net applet ?
Mar 17th , 2009, 5:42pm
Hi, i want to put my webcam on a website, but applet client doesn't work. Serveur work on my local machine, client work when i export application but client doesn't work on website with applet export ( i have a white square ), so why ? code serveur : import processing.net.*; import processing.video.*; Server myServer; Capture cam; int H=200; int numpix; int[] Prvblist = new int[H*H*3]; byte[] pixelS = new byte[40000]; void setup(){ frameRate(5); size(H,H); cam = new Capture(this,width,height,24); myServer = new Server(this,5204); numpix = cam.width * cam.height; loadPixels(); } void draw(){ cam.read(); cam.loadPixels(); for(int i=0;i<numpix;i++){ // i separe r/v/b, for byte send. pixels[i] = cam.pixels[i]; Prvblist[i*3] = int(red(cam.pixels[i])); Prvblist[i*3+1] = int(green(cam.pixels[i])); Prvblist[i*3+2] = int(blue(cam.pixels[i])); } pixelS = byte(Prvblist); myServer.write(pixelS); updatePixels(); } code client: import processing.net.*; Client myClient; byte[] byteBuffer = new byte[40000*3]; int[] IbyteBuffer = new int[40000*3]; void setup(){ frameRate(5); size(200,200); loadPixels(); myClient = new Client(this,"192.168.1.20",5204);//local address for test } void draw(){ if(myClient.available() > 40000*3){ int byteCount = myClient.readBytes(byteBuffer); if(byteCount >= 40000*3){ IbyteBuffer = int(byteBuffer); for(int i=0;i<40000;i++){ pixels[i] = color(IbyteBuffer[i*3],IbyteBuffer[i*3+1],IbyteBuffer[i*3+2]); byteBuffer[i] = 0; } updatePixels(); } } } + : - i have opened port 5204 on my routeur. - i have windows xp, i test on I.E. and Firefox. - i use processing 1.0.3 maybe sorry for my english, and pls help me lol.