当前位置:网站首页>Wechat applet uses wxml2canvas plug-in to generate some problem records of pictures
Wechat applet uses wxml2canvas plug-in to generate some problem records of pictures
2022-04-23 07:22:00 【qq_ fifteen million one hundred and ninety-seven thousand four 】
Text cannot be bold
css Style add font-weight:bold, But the font of the generated image is not bold . Check the plug-in source code , Find out bold Replaced with 700( If the word weight is not set, it is 400)
terms of settlement : Here is the source code _drawText The red box position of the method , Direct will 700 Replace with bold, The plug-in can draw the BOLD effect normally .
The drawing results are disordered ( Part of the content is not drawn )
reason 1: Network picture
First , Domain name of network picture , Must be set in the applet "downloadFile Legitimate domain name " Inside , Otherwise, you can't draw a picture , And cause the image All elements after the element are not drawn ( The plug-in does not report an error )
secondly , Network pictures need to be downloaded to the cache in advance , Otherwise, it's impossible to draw the picture , And it also causes the following elements not to draw .

terms of settlement : Use wx.downloadFile Download all pictures in advance , And replace src Cache pictures for src
Last , Recommended at all image Add... To the tag data-delay="1" attribute ,
The advantage of this is , Delay the picture until all text elements are drawn , Even if a picture is drawn incorrectly , It will not cause the following text content to be unable to be drawn , Reduce risk .( Put the background map in local resources , Don't delay, Otherwise, the text content will be overwritten )
reason 2: The drawing order is out of order .
The default drawing page of the plug-in has no scroll bar , And only draw the current screen content . If you draw long content , And when the page scrolls , The drawing results will be confused .

After detecting the source code, I found , When sorting inside the plug-in , Using elements top Value as array subscript , Because after the scroll bar , The element at the top of the page top It's a negative number , Negative array subscripts when sorting , Was wrongly ranked at the end , This leads to elements that should have been drawn first , Finally draw , And there is an error coverage problem .

terms of settlement : In source _sortListByTop In the way , Add the code in the red box , First, traverse the minimum of all elements top value , If it's negative , The reverse is true , And add to top in , This ensures that the array subscript is at least 0, There will be no wrong sort problem .
PS: If top The value has a decimal number , At this time, there will also be problems when the plug-in is used as an array subscript , Please make sure top The value is integer. .
Last , Effect of finished drawing ( There are only methods to draw rounded corner pictures in the plug-in , There is no way to draw rounded rectangles , Too lazy to mend ~)

版权声明
本文为[qq_ fifteen million one hundred and ninety-seven thousand four ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230609264816.html
边栏推荐
- [Point Cloud Series] SG - Gan: Adversarial Self - attachment GCN for Point Cloud Topological parts Generation
- PyTorch 13. 嵌套函数和闭包(狗头)
- [dynamic programming] longest increasing subsequence
- 【点云系列】FoldingNet:Point Cloud Auto encoder via Deep Grid Deformation
- c语言编写一个猜数字游戏编写
- Android exposed components - ignored component security
- 机器学习 三: 基于逻辑回归的分类预测
- 图像分类白盒对抗攻击技术总结
- 如何对多维矩阵进行标准化(基于numpy)
- DCMTK (dcm4che) works together with dicoogle
猜你喜欢

第3章 Pytorch神经网络工具箱

【點雲系列】SG-GAN: Adversarial Self-Attention GCN for Point Cloud Topological Parts Generation
![[3D shape reconstruction series] implicit functions in feature space for 3D shape reconstruction and completion](/img/4d/6d5821759766a6bf1d77ad51b69e24.png)
[3D shape reconstruction series] implicit functions in feature space for 3D shape reconstruction and completion

Visual studio 2019 installation and use
![Android interview Online Economic encyclopedia [constantly updating...]](/img/48/dd1abec83ec0db7d68812f5fa9dcfc.png)
Android interview Online Economic encyclopedia [constantly updating...]

GEE配置本地开发环境

Use originpro express for free

Component based learning (3) path and group annotations in arouter

Miscellaneous learning
![[2021 book recommendation] artistic intelligence for IOT Cookbook](/img/8a/3ff45a911becb895e6dd9e061ac252.png)
[2021 book recommendation] artistic intelligence for IOT Cookbook
随机推荐
Infrared sensor control switch
1.2 初试PyTorch神经网络
Machine learning III: classification prediction based on logistic regression
torch_geometric学习一,MessagePassing
[2021 book recommendation] red hat rhcsa 8 cert Guide: ex200
机器学习——朴素贝叶斯
【点云系列】Learning Representations and Generative Models for 3D pointclouds
PyTorch最佳实践和代码编写风格指南
【点云系列】点云隐式表达相关论文概要
PyMySQL连接数据库
C language, a number guessing game
Chapter 2 pytoch foundation 1
Machine learning notes 1: learning ideas
PyTorch 21. PyTorch中nn.Embedding模块
Reading notes - activity
【點雲系列】SG-GAN: Adversarial Self-Attention GCN for Point Cloud Topological Parts Generation
MySQL installation and configuration - detailed tutorial
PyTorch 20. PyTorch技巧(持续更新)
【点云系列】DeepMapping: Unsupervised Map Estimation From Multiple Point Clouds
1.1 PyTorch和神经网络