Gary Gekko
2009-Jan-17 16:12 UTC
Take a picture from the webcam and save it into the database
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 ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---