Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8691179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:04:21+00:00 2026-06-13T00:04:21+00:00

I am capturing image using canvas and i want to store a captured image

  • 0

I am capturing image using canvas and i want to store a captured image in MySQL Database using Javascript.

This is my code:

<html>  
      <head>
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, maximum-scale=1.0">
            <style>
                body {width: 100%;}
                canvas {display: none;}
            </style>
            <title>Instant Camera - Remote</title>
            <script>

                var video, canvas, msg;
                var load = function () {
                    video  = document.getElementById('video');
                    canvas = document.getElementById('canvas');
                    msg    = document.getElementById('error');
                    if( navigator.getUserMedia ) {
                        video.onclick = function () {
                            var context = canvas.getContext("2d");
                            context.drawImage(video, 0, 0, 240, 320);
                            var image1 = canvas.toDataURL("image/png");
                    document.write('<img src="' + image1 + '" />');         
                        };

                    } else {
                        msg.innerHTML = "Native web camera not supported :(";
                    }
                };

                window.addEventListener('DOMContentLoaded', load, false);
            </script>
        </head>
        <body>
            <video  id="video" width="240" height="320" autoplay> </video>
            <p      id="error">Click on the video to send a snapshot to the receiving screen</p>
            <canvas id="canvas" width="240" height="320"> </canvas>
        </body>
        </html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:04:22+00:00Added an answer on June 13, 2026 at 12:04 am

    getting a canvas “screenshot”, encoding it into a BASE64 string, sending it to a servlet/php/etc and storing it in mysql should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently i m capturing the screen using the glreadpixels(). the image captured is generally
i am using following code for capturing the image in Android: String fileName =
I am capturing an image using the following code public class PictureDemo extends Activity
how to store the imagePath of the image that I had captured using the
If i am capturing an image and inserting it inside the database. this is
I want to give zoom effect to the iPhone camera image while capturing the
Possible Duplicate: lambdas require capturing 'this' to call static member function? I want to
I'm having trouble capturing the digits in a string of this format (t|b|bug_|task_|)1234 using
in my app i want use the camera for capturing image and send to
I am trying to rotate a UIImage while capturing an image using the camera.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.