Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <div class="row" id="webCam">
  2. <div class="col-xs-12 col-md-12">
  3. <div id="my_camera" style="width: 210px; height: 190px;"></div>
  4. <button id="takePhoto">Take Snapshot</button>
  5. </div>
  6. </div>
  7.  
  8. //capture image frome web cam
  9. function captureFromCam() {
  10. $('#webCam').show();
  11.  
  12. Webcam.set({
  13. width: 200,
  14. height: 180,
  15. dest_width: 230,
  16. dest_height: 200,
  17. //image_format: 'jpeg',
  18. jpeg_quality: 90
  19. //force_flash: false
  20. });
  21. Webcam.attach('#my_camera');
  22. Webcam.setSWFLocation("~/jQuery-Plugin/webcam/webcam.swf");
  23. }
  24.  
  25. function take_snapshot() {
  26. Webcam.snap(function (data_uri) {
  27. //document.getElementById('my_result').innerHTML = '<img src="' + data_uri + '"/>';
  28. $('#imgprvw').attr('src', data_uri);
  29. image = data_uri;
  30. $('#webCam').hide();
  31. Webcam.reset();
  32. });
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement