Home  >  Article  >  WeChat Applet  >  WeChat applet drawImage understanding

WeChat applet drawImage understanding

小云云
小云云Original
2018-03-17 13:45:443138browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn