This article mainly shares with you the understanding of WeChat applet drawImage, hoping to help everyone
1.drawImage parameters
2. Use cases
1. When uploading pictures: chooseImage is the interface for calling the camera and mobile phone album
2. Draw the specified picture (the picture is directly in the images folder of the mini program)
const ctx = wx.createCanvasContext('myCanvas'); ctx.drawImage('../uploads/foods.jpg', 0, 0, 150, 100); ctx.draw();
Related recommendations:
Usage examples of drawImage (image scaling or cropping) in H5 Canvas API
HTML5 uses the drawImage() method to draw images_html5 tutorial skills
Analysis of drawImage usage in HTML5_html5 tutorial skills
The above is the detailed content of WeChat applet drawImage understanding. For more information, please follow other related articles on the PHP Chinese website!