The first step:

Download the package and put the Painter package in the Components directory

 https://github.com/Kujiale-Mobile/Painter
Copy the code

The second step:

Use the page in the JSON file to import

{
  "usingComponents": {
    "painter":"/components/painter/painter"
  }
}
Copy the code

Step 3:

Use the WXML of the page

<image mode="widthFix" SRC ="{{posterImg}}" id=" goods_qR-code "Alt /> <painter wx-if="{{painter}}" Bind :imgOK="firstImg" /> Palette ="{{data}}" bind:imgOK="firstImg" /> Palette ="{{data}}" bind:imgOK="firstImg" You can get an image of success or a cause of failure by binding an imgOK or imgErr eventCopy the code

Step 4:

Use the page’s JS

{this.setdata ({template: {width: "750rpx", height: "1500rpx", views: [{type: 'image', url: 'image', CSS: { top: '10rpx', left: '10rpx', right: '10rpx', width: '730rpx', height: '1500rpx'}}]}})} Poster generated automatically call firstImg(e) {console.log(e.dyail.path); this.setData({ posterImg: e.detail.path }) },Copy the code
Plug-in introduction and official website:

Painter generated poster