Can we place a canvas inside the existing canvas?If we can,please help to do it in html5.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
There are two possible ways to interpret your question. One is that you mean to actually nest
canvaselements themselves, like this:This is legal (according to validator.nu) but pointless. The content inside the
canvaselement is for fallback. The only way the content inside thecanvaselement gets used is if the browser doesn’t supportcanvas, in which case the innercanvaselement won’t be seen anyway.The other possible way to interpret your question is can you display the image shown on one canvas within another. This is quite straightforward, a
canvaselement can be used as the first parameter tocontext.drawImage(). If you have twocanvaselements:Then this script (using jQuery) will draw on the first
canvasand then add that four times as an image to the secondcanvas:But again, why would you? You can replicate the image of the second
canvasabove just using one:So in summary: yes, it’s possible, but it’s not really necessary in simple use.