WeChat applet drawImage understanding

小云云
Release: 2018-03-17 13:45:44
Original
3138 people have browsed it

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();
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!