Take a picture from the webcam and save it into the database


#1

Hi everyone,

I’m trying to create an application to take pictures from the users’
webcam and save them into the database.

This is my actionscript code :

Code :

  1. import flash.display.BitmapData;
  2. localCamera = Camera.get();
  3. myCam.attachVideo(localCamera);
  4. var bitmap = new flash.display.BitmapData(320, 240, true,
    0x00000000);
  5. this.createEmptyMovieClip(“pic”, 2);
  6. pic.attachBitmap(bitmap, 20, “auto”, true);
  7. btn.onRelease = function() {
  8. lv = new LoadVars();
  9. lv.tab = new Array();
  10. for (i=0; i<240; i++) {
  11. for (j=0; j<320; j++) {
    
  12.   lv.tab.push(bitmap.getPixel(j, i));
    
  13. }
    
  14. }
  15. lv.send(“validate_upload_flash”, “_blank”, “POST”);
  16. };

And here comes my issue : in PHP, I’d use a imagesetpixel method. But in
RoR, I just don’t know what to do !

Any help ?