当前位置:网站首页>How to save the contents of div as an image- How to save the contents of a div as a image?
How to save the contents of div as an image- How to save the contents of a div as a image?
2022-07-04 15:52:00 【Bustling city 】
problem :
Basically, I am doing what the heading states, attempting to save the contents of a div as an image. Basically , I'm doing what the title says , Attempt to div The content of is saved as an image .
I plan on making a small online application for the iPad. I plan to iPad Make a small online application .
One function that is a must is having a 'Save' button that can save the full webpage as an image, and save that image to the iPad's camera roll. A necessary function is to have a “ preservation ” Button , You can save the entire web page as an image , And save the image to iPad In my camera film .I wish to save the full contents of a div, not just the visible area. I want to save div The whole content of , Not just visible areas .
I have searched briefly online, but couldn't find much documentation on anything. I did a short search on the Internet , But I can't find any documents about anything .I found a lot on HTML5 Canvas. I am here HTML5 Canvas Found a lot on .Here is some code I put together: Here are some codes I put together :
<script>function saveimg(){ var c = document.getElementById('mycanvas'); var t = c.getContext('2d'); window.location.href = image; window.open('', document.getElementById('mycanvas').toDataURL());}</script><div id="mycanvas">This is just a test<br />12344<br /></div><button onclick="saveimg()">Save</button>
Although, I am getting this error: although , I received this error :
TypeError: c.getContext is not a function
This application will be built only with HTML, CSS and jQuery (or other Javascript libraries). This application will only use HTML、CSS and jQuery( Or others Javascript library ) structure .
Solution :
Reference resources : https://stackoom.com/en/question/1Fxrf边栏推荐
- 【大连理工大学】考研初试复试资料分享
- 2022年九大CIO趨勢和優先事項
- How to rapidly deploy application software under SaaS
- Digital recognition system based on OpenCV
- AI做题水平已超过CS博士?
- 左右对齐!
- AI has surpassed Dr. CS in question making?
- Unity脚本常用API Day03
- Big God explains open source buff gain strategy live broadcast
- 直播预告 | PostgreSQL 内核解读系列第二讲:PostgreSQL 体系结构
猜你喜欢
Redis shares four cache modes
每周招聘|高级DBA年薪49+,机会越多,成功越近!
Case sharing | integrated construction of data operation and maintenance in the financial industry
I plan to teach myself some programming and want to work as a part-time programmer. I want to ask which programmer has a simple part-time platform list and doesn't investigate the degree of the receiv
MySQL学习笔记——数据类型(2)
在芯片高度集成的今天,绝大多数都是CMOS器件
Quelles sont les perspectives de l'Internet intelligent des objets (aiot) qui a explosé ces dernières années?
干货 | fMRI标准报告指南新鲜出炉啦,快来涨知识吧
Detailed explanation of MySQL composite index (multi column index) use and optimization cases
LNX efficient search engine, fastdeploy reasoning deployment toolbox, AI frontier paper | showmeai information daily # 07.04
随机推荐
暑期复习,一定要避免踩这些坑!
Logstash ~ detailed explanation of logstash configuration (logstash.yml)
Lombok使用引发的血案
Dry goods | fMRI standard reporting guidelines are fresh, come and increase your knowledge
Redis' optimistic lock and pessimistic lock for solving transaction conflicts
干货 | fMRI标准报告指南新鲜出炉啦,快来涨知识吧
MySQL~MySQL给已有的数据表添加自增ID
Selenium element interaction
%F format character
宽度与对齐
LNX efficient search engine, fastdeploy reasoning deployment toolbox, AI frontier paper | showmeai information daily # 07.04
【读书会第十三期】 音频文件的封装格式和编码格式
Understand Alibaba cloud's secret weapon "dragon architecture" in the article "science popularization talent"
c# 实现定义一套中间SQL可以跨库执行的SQL语句
Unity预制件Prefab Day04
Unity脚本介绍 Day01
Temperature control system based on max31865
PXE network
Selenium browser (2)
深入JS中几种数据类型的解构赋值细节