Forum: Ruby on Rails Take a picture from the webcam and save it into the database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gary G. (Guest)
on 2009-01-17 18:12

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.
   5. var bitmap = new flash.display.BitmapData(320, 240, true,
0x00000000);
   6. this.createEmptyMovieClip("pic", 2);
   7. pic.attachBitmap(bitmap, 20, "auto", true);
   8. btn.onRelease = function() {
   9.   lv = new LoadVars();
  10.   lv.tab = new Array();
  11.   for (i=0; i<240; i++) {
  12.     for (j=0; j<320; j++) {
  13.       lv.tab.push(bitmap.getPixel(j, i));
  14.     }
  15.   }
  16.   lv.send("validate_upload_flash", "_blank", "POST");
  17. };

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 ?
This topic is locked and can not be replied to.