primitive.js实现位图图片转换成矢量图绘制过程代码

代码语言:html

所属分类:其他

代码描述:primitive.js实现位图图片转换成矢量图绘制过程代码

代码标签: primitive.js 位图 图片 转换 矢量图 绘制 过程

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" />

    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/primitive.js"></script>
</head>

<body>
    <img src="/asset/logo.png" width="500" height="375">
    <p><input type="button" id="button" value="点击变身"></p>
    <div id="container"></div>

    <script>
        document.getElementById('button').addEventListener('click', function () {
            var Canvas = PRIMITIVE.Canvas;    
            var Optimizer = PRIMITIVE.Optimizer;
            var cfg = {
                alpha: 0.5,
                computeSize: 256,
                fill: "rgb(0, 0, 0)",
                height: 375,
                mutateAlpha: true,
        .........完整代码请登录后点击上方下载按钮下载查看

网友评论0