canvas 2d toDataURL

 

 

复制代码
var ab = document.createElement('canvas');
var ac = ab.getContext('2d');
ac['textBaseline'] = 'alphabetic';
ac['fillStyle'] = '#f60';
ac['fillRect'](0x7d, 0x1, 0x3e, 0x14);
ac['fillStyle'] = '#069';
ac['font'] = '11pt Arial';
ac['fillText']('Cwm fjordbank glyphs vext quiz, 😃', 0x2, 0xf);
ac['fillStyle'] = 'rgba(102, 204, 0, 0.7)';
ac['font'] = '18pt Arial';
ac['fillText']('Cwm fjordbank glyphs vext quiz, 😃', 0x4, 0x2d);
var ad = ac.createLinearGradient(0x0, 0x0, ab.width, ab.height);


ad.addColorStop(0x0, 'blue');
ad.addColorStop(0x1, 'red');
ac['fillStyle'] = ad;
ac['fillRect'](0x0, 0x19, 0x64, 0x64);
ac.beginPath();
ac.moveTo(0x32, 0x32);
ac.bezierCurveTo(0x14, 0x64, 0xc8, 0x64, 0xc8, 0x32);
ac.stroke();
ab.toDataURL();
复制代码

 

posted @   AngDH  阅读(8)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· [翻译] 为什么 Tracebit 用 C# 开发
· Deepseek官网太卡,教你白嫖阿里云的Deepseek-R1满血版
· DeepSeek崛起:程序员“饭碗”被抢,还是职业进化新起点?
· 2分钟学会 DeepSeek API,竟然比官方更好用!
· .NET 使用 DeepSeek R1 开发智能 AI 客户端
历史上的今天:
2023-07-29 python requests.session() 不使用session的cookie 自定义cookie
2021-07-29 hadoop2 安装
2019-07-29 python基础 filter ,列表,字典,集合 中根据 条件 筛选 数据
点击右上角即可分享
微信分享提示