Get the App
SLTechnology News&Howtos  ›  Development  › 

WeChat Mini Programs's method of drawing and exporting pictures in API

Shulou Source: shulou.com Published: 2022-06-01 05:46:51 10月01日 Update

This article mainly introduces "WeChat Mini Programs API drawing export picture method". In the daily operation, I believe that many people have doubts about the method of WeChat Mini Programs API drawing export picture. The editor consulted all kinds of data and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubts of "WeChat Mini Programs API drawing export picture method". Next, please follow the editor to study!

Wx.canvasToTempFilePath (OBJECT) exports the contents of the specified area of the current canvas to generate a picture of the specified size and returns the file path. OBJECT parameter description: parameter type is required: minimum version xNumber No canvas x axis start point (default 0) 1.2.0yNumber No canvas y axis start point (default 0) 1.2.0widthNumber No canvas width (default is canvas width-x) 1.2.0heightNumber No canvas height (default is canvas height-y) 1.2.0destWidthNumber No output picture width (default is width) 1.2.0destHeightNumber No output picture height (default Think height) 1.2.0canvasIdString is the canvas logo The passed cavas-idsuccessFunction No API calls the successful callback function failFunction No API calls the failed callback function completeFunction No API calls the finished callback function (successful or failed) sample code wx.canvasToTempFilePath ({x: 100,200, width: 50, height: 50, destWidth: 100, destHeight: 100, canvasId: 'myCanvas', success: function (res) {console.log (res.tempFilePath)}}) On the "WeChat Mini Programs API drawing export picture method" study is over, I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Picture canvas method program drawing learning function width interface height success parameters more starting point help output practical minimum next code Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux NVidia Shulou Information MariaDB Apple