Giter VIP home page Giter VIP logo

miniprogrampostercanvas's Introduction

MiniProgramPosterCanvas

Codebeat LICENSE 3

MiniProgramPosterCanvas is a tool to generate poster in MiniProgram with Canvas.

中文介绍

Overview

Demo

  1. To run the example project manually, clone the repo, demos are in the 'Examples' folder;
  2. After you download the file, use the WeChatMiniProgramDevTool to open the file;
  3. pages/index/index.html is main function;
  4. You can change expressData in index.js to custom the poster.

Requirements

Quick Start

1. Realization principle

  1. Using JSON to make page configurable;
  2. Generate image with Canvas.

2. Request data description

expressData: {
      data: {
        // 这个是背景图
        imgPath:
          "http://imgs-1253854453.cossh.myqcloud.com/fdbd20b19b6ab2ea2f12b4910ac91d45.png",
        // 这个是需要生成的二维码的信息
        // code:需要转为二维码的数据
        // width: 二维码宽度
        // height:二维码高度
        // x:x轴的坐标
        // y:y轴的坐标
        qrCodeUrl: {
          code: "www.jd.comfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdf",
          width: 110,
          height: 110,
          x: 224,
          y: 370
        },
        // 页面其他元素
        // type: 后端返回数据有两种,image(图片)和text(文本)
        // imgUrl: 图片元素的链接
        // text:文本内容
        // width:宽度
        // height:高度
        // x: x轴的坐标
        // y: y轴的坐标
        // isCircle: 判断是否是用户头像
        // color: 文本的颜色
        // font:字体大小与类型
        list: [
          {
            type: "image",
            imgUrl:
              "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eoFN9WMUV2y7un0hvsBbIc5W9Q94nuQlIhBso2Kib6vRXibgUia8pE60W1LTGmGOk4bC7BfsWBia3Xufw/132",
            width: 50,
            height: 50,
            x: 40,
            y: 53,
            isCircle: true
          },
          {
            type: "image",
            imgUrl:
              "http://imgs-1253854453.cossh.myqcloud.com/0aa8a0e8f25a0f608deefb36c34be39f.jpg",
            width: 242,
            height: 242,
            x: 70,
            y: 120
          },
          {
            type: "text",
            text: "迪士尼儿童背带",
            color: "#f00",
            font: "24px Airal",
            x: 30,
            y: 400
          },
          {
            type: "text",
            text: "2081",
            color: "#000",
            font: "16px Airal",
            x: 90,
            y: 427
          }
        ]
      }
    }

Contact

mingying,[email protected];
danchaofan,[email protected].

License

MiniProgramPosterCanvas is available under the MIT license. See the LICENSE file for more info.

miniprogrampostercanvas's People

Contributors

302wanger avatar eyrefree avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.