当前位置:网站首页>The foreground downloads network pictures without background processing
The foreground downloads network pictures without background processing
2022-07-07 01:56:00 【Novice Zhang~】
let url = 'https://s-cf-tw.shopeesz.com/file/5d5b0c9ff52be2ce2bd5aa47f9791cc1';
let image = new Image()
image.setAttribute('crossOrigin', 'anonymous')
image.src = url
image.onload = () => {
let canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
let ctx = canvas.getContext('2d')
ctx.drawImage(image, 0, 0, image.width, image.height)
canvas.toBlob((blob) => {
let url = URL.createObjectURL(blob)
let eleLink = document.createElement('a')
eleLink.download = 'dsfad'
eleLink.href = url
eleLink.click()
eleLink.remove()
URL.revokeObjectURL(url)
})
}
边栏推荐
- LeetCode. 剑指offer 62. 圆圈中最后剩下的数
- 爬虫实战(六):爬笔趣阁小说
- Shell script quickly counts the number of lines of project code
- JS how to quickly create an array with length n
- ROS learning (25) rviz plugin
- 制作带照明的DIY焊接排烟器
- AcWing 344. 观光之旅题解(floyd求无向图的最小环问题)
- Instructions for using the domain analysis tool bloodhound
- 百度飞将BMN时序动作定位框架 | 数据准备与训练指南 (下)
- 蓝桥杯2022年第十三届省赛真题-积木画
猜你喜欢
@Before, @after, @around, @afterreturning execution sequence
Can't you understand the code of linked list in C language? An article allows you to grasp the secondary pointer and deeply understand the various forms of parameter passing in the function parameter
ROS学习(22)TF变换
Yiwen takes you into [memory leak]
永久的摇篮
Appium基础 — Appium Inspector定位工具(一)
盒子拉伸拉扯(左右模式)
AcWing 361. Sightseeing cow problem solution (SPFA seeking positive ring)
刨析《C语言》【进阶】付费知识【二】
Appium automation test foundation uiautomatorviewer positioning tool
随机推荐
mongodb查看表是否导入成功
Batch delete data in SQL - set in entity
使用nodejs完成判断哪些项目打包+发版
Shell script quickly counts the number of lines of project code
ROS learning (24) plugin
AcWing 346. Solution to the problem of water splashing festival in the corridor (deduction formula, minimum spanning tree)
npm install 编译时报“Cannot read properties of null (reading ‘pickAlgorithm‘)“
CISP-PTE实操练习讲解(二)
C语言【23道】经典面试题【下】
shell脚本快速统计项目代码行数
AcWing 1148. Secret milk transportation problem solution (minimum spanning tree)
C language [23] classic interview questions [Part 2]
Ds-5/rvds4.0 variable initialization error
Domestic images of various languages, software and systems. It is enough to collect this warehouse: Thanks mirror
JVM memory model
新工作感悟~辞旧迎新~
ROS learning (XX) robot slam function package -- installation and testing of rgbdslam
我如何编码8个小时而不会感到疲倦。
According to the analysis of the Internet industry in 2022, how to choose a suitable position?
2022/0524/bookstrap