Giter VIP home page Giter VIP logo

canvas-draw-poster's Introduction

canvas-draw-poster.js

  • canvas-draw-poster.js 是一个基于canvas生成海报的插件,支持导出海报图片。

install

 npm i canvas-draw-poster

use

import CanvasPoster from "canvas-draw-poster"
const poster=new CanvasPoster({
    target:xxx,
    width:xxx,
    height:xxx,
})

api

事件 说明 参数
options 初始化参数 一个对象{target,width,height,ratio}
drawRect 绘制矩形 一个对象{x,y,width,height,color}
drawLine 绘制线条 一个对象{startX,startY,endX,endY,color}
drawTextList 绘制多个文字 一个数组,数组元素是对象, 对象包含{value,x,y,color,size,fontFamily}
drawText 绘制文字 一个对象,对象包含{value,x,y,color,size,fontFamily}
drawSingleImage 绘制单张图片 一个对象,对象包含{x,y,imageData,width,height}
drawImageList 绘制多张图片 一个数组,数组元素是一个对象,对象包含{x,y,imageData,width,height}
saveImg 导出图片数据

canvas-draw-poster's People

Contributors

xukeler avatar

Stargazers

 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.