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 8306441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:19:52+00:00 2026-06-08T18:19:52+00:00

Consider if two boxes on each side, the boxes will have 5 entries each,

  • 0

Consider if two boxes on each side, the boxes will have 5 entries each, the left boxes we have animal names like dog,cat,tiger,elephant,monkey. The right will have milk,goat,coconut,bones,banana.

Now using the canvas element i need to map these 2 box elements and save the result in Database and i need to retrieve it again the next time as well.

How do i implement this one?

Thanks in advance..

  • 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-08T18:19:54+00:00Added an answer on June 8, 2026 at 6:19 pm

    If you want to save your canvas to a database, then you’ll need to convert the canvas to a Base64 string and then save this string to the database like this:

    <input type="text" name="mybase64" />
    
    <script type="text/javascript">
        function saveClicked() {
            var dataURL = document.getElementsByTagName("canvas")[0].toDataURL("image/jpeg");
            $("input[name=\"mybase64\"]").val(dataURL);
        }
    </script>
    

    You will then post this mybase64 to whatever web service / code behind page that will received and write this string to your storage medium. To redraw the image to the canvas, you would get your base64 string from your DB and write it to the canvas like this:

    function drawCanvas(myBase64String) {
        var canvas = document.getElementsByTagName("canvas")[0];
        var context = canvas.getContext("2d");
        var image = new Image();
        image.src = myBase64String;
        image.onload = function() {
            context.drawImage(image, 0, 0);
        }
    }
    

    The main answer to your question is, if you want to store your canvas to a database it MUST be done in base64 form.

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

Sidebar

Related Questions

let's consider two views that use the same layout composed of: A left column
I m not very versed in Hibernate and have following query: Consider two classes:
Consider two tables transaction and category each having their own ID and information. A
Today, I've stumbled over the following: Consider two classes NewClass and NewClass1, which have
Consider two directories: /home/user/music/flac /media/MUSIC/flac I would like the second directory (destination; a USB
Consider two controls that do basically the same things. For instance, a gridview-like-widget with
Consider the following HTML and CSS. The desired result is the two pink boxes
Consider these two df examples df1=data.frame(names=c('a','b','c'),value=1:3) df2=data.frame(names=c('c','a','b'),value=1:3) so that > df1 names value 1
Consider two tables: Transactions , with amounts in a foreign currency: Date Amount =========
Consider two methods on the controller CustomerController.cs : //URL to be http://mysite/Customer/ public ActionResult

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.