Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Mini Program to generate posters

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Today, I will talk to you about how to use Mini Program to generate posters, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something from this article.

Mini Program native code generation poster

Step one:

Download the package and put the painter package in the components directory

Https://github.com/Kujiale-Mobile/Painter

[recommended for related study: Mini Program Development tutorial]

Step 2:

Use the json file of the page to introduce the

{"usingComponents": {"painter": "/ components/painter/painter"}}

Step 3:

Use the wxml of the page

The palette field of the picture container that receives the poster is used as the data source of the drawing data. The pattern data is stored in the form of json. WidthPixels forces the pixel width of the generated picture to be specified. After the drawing is completed, the successful picture or the reason for failure can be obtained by binding the imgOK or imgErr event.

Step 4:

Use the js of the page

The method for generating posters () {this.setData ({template: {width: "750rpx", height: "1500rpx", views: [{type: 'image', url: image path, css: {top:' 10rpx') Left: '10rpxcards, right:' 10rpxposts, width: '730rpxwords, height:' 1500rpx`})})} automatically call firstImg (e) {console.log (e.detail.path) after poster generation This.setData ({posterImg: e.detail.path})}

Plug-in introduction and official website: Painter generates posters

Https://codechina.csdn.net/mirrors/Kujiale-Mobile/Painter?utm_source=csdn_github_accelerator

After reading the above, do you have any further understanding of how to use Mini Program to generate posters? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report