
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
简化 Canvas 渲染逻辑为初心的轻量级插件。
Bate
阶段,需要不断完善,希望做最简单的轻量级的 Canvas 插件下载安装:
npm install --save i-painter
<!-- index.html -->
<script src="xx/xx/i-painter.js"></script>
<script>
let Pen = new Painter(el);
</script>
import Painter from "i-painter";
let Pen = new Painter(el);
Painter.drawImage(string || object);
属性 | 是否必填 | 作用 |
---|---|---|
url(string) | √ | 图片地址 |
- | - | - |
url | √ | 图片地址 |
x | × | x 轴坐标,默认值:0 |
y | × | y 轴坐标,默认值:0 |
w | × | 图片宽度,默认值:画布宽度 |
h | × | 图片高度,默认值:画布高度 |
Painter.drawText(string || object);
属性 | 是否必填 | 作用 |
---|---|---|
text(string) | √ | 文本 |
- | - | - |
text | √ | 文本 |
x | × | x 轴坐标,默认值:0 |
y | × | y 轴坐标,默认值:0 |
size | × | 字体大小:默认值:24 |
color | × | 字体颜色:默认值:#FFFFFF |
position | × | 字体定位,可选值:left | center | right 默认值:left |
hollow | × | 是否空心,默认值:false |
Painter.drawRect(object);
属性 | 是否必填 | 作用 |
---|---|---|
x | × | x 轴坐标,默认值:0 |
y | × | y 轴坐标,默认值:0 |
w | × | 宽度,默认值:100 |
h | × | 高度,默认值:100 |
color | × | 颜色:可传 string | array, 默认值:#FFFFFF |
radius | × | 圆角:默认值:0 |
hollow | × | 是否空心,默认值:false |
Painter.drawRound(object);
属性 | 是否必填 | 作用 |
---|---|---|
x | × | x 轴坐标,默认值:0 |
y | × | y 轴坐标,默认值:0 |
r | × | 半径,默认值:10 |
border | × | 边框,默认值:10 |
color | × | 颜色:可传 string, 默认值:#FFFFFF |
hollow | × | 是否空心,默认值:false |
Painter.getDataURL();
Painter.toDownload(filename);
属性 | 是否必填 | 作用 |
---|---|---|
filename | × | 下载图片名,默认值:i-painter |
Painter.toElementImage();
FAQs
> 简化 Canvas 渲染逻辑为初心的轻量级插件。
We found that i-painter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.