Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use wx.getImageInfo () to get picture information in WeChat Mini Programs

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will introduce "how to use wx.getImageInfo () to get picture information in WeChat Mini Programs". The content steps are clear and detailed, and the details are handled properly, while the editor updates different knowledge points every day. I hope this article "how to use wx.getImageInfo () to get picture information in WeChat Mini Programs" will give you unexpected gains. Please follow the editor's ideas slowly and deeply. The details are as follows. Let's go and gain new knowledge.

Get picture information

OBJECT parameter description:

Parameter type is required to indicate that srcString is the path of the picture, which can be relative path, temporary file path, storage file path, network image path successFunction No API call successful callback function failFunction No API call failed callback function completeFunction No API call end callback function (both successful and failed calls will be executed)

Success return parameter description:

Parameter type describes widthNumber picture width, unit pxheightNumber picture height, and unit pxpathString returns the local path of the picture.

Sample code:

Wx.getImageInfo ({src: 'images/a.jpg', success: function (res) {console.log (res.width) console.log (res.height)}}) wx.chooseImage ({success: function (res) {wx.getImageInfo ({src: res.tempFilePaths [0]) Success: function (res) {console.log (res.width) console.log (res.height)})}}) what does Mini Program mean? Mini Program is an application that can be used without download or installation. By scanning the QR code or searching it for immediate use, it is easy to operate and easy to spread, and can achieve seven functions such as message notification, offline code scanning, official account association and so on. It is based on Wechat, similar to APP. You can use it whenever you want. After using it, you will leave without taking up memory.

Thank you for reading this. The editor hopes that you have the most profound experience from the practical level on the key issue of "how to use wx.getImageInfo () to get picture information in WeChat Mini Programs". The specific use also requires everyone to practice and use it before you can understand it. If you want to read more related articles, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report