How does Mini Program choose pictures locally or use the camera function to take pictures?
The knowledge of this article "how Mini Program chooses pictures locally or uses the camera to take pictures" is not quite understood by most people, so the editor summarizes the following contents for you. The contents are detailed, the steps are clear, and they can be used for reference. I hope you can get something after reading this article. Let's take a look at this "how Mini Program chooses pictures locally or uses the camera to take pictures".
Wx.chooseImage (OBJECT)
Select a picture from your local album or take a picture with a camera.
Sample code:
1 wx.chooseImage ({2 count: 1, / / default 93 sizeType: ['original',' compressed'], / / you can specify whether it is the original image or a compressed image. By default, both have 4 sourceType: ['album',' camera'], / / you can specify whether the source is a photo album or a camera, and by default both have 5 success: function (res) {6 / / returns the local file path list of the selected photo TempFilePath can be used as the src attribute of the img tag to display pictures 7 var tempFilePaths = res.tempFilePaths8}. The above is about "how Mini Program selects pictures locally or uses the camera to take pictures". I believe you all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.