Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小程序中 导出成图片 canvasToTempFilePath: fail canvas is empty? #68

Open
Airsola opened this issue Apr 8, 2019 · 1 comment

Comments

@Airsola
Copy link

Airsola commented Apr 8, 2019

使用

wx.canvasToTempFilePath({
  canvasId: 'caxCanvas0',
                fileType: 'jpg',
                quality: '0.9',
                x: 0,
                y: 0,
                width: 750,
                height: 1100,
                destWidth:  750,
                destHeight: 1100,
                success: function (res) {
                  console.log('success', res);
                },
                fail: function (e) {
                  console.log('fail', e);
                }
}, this)

wx.canvasToTempFilePath 这个参数设置为this 了,导出图片时依然是提示
canvasToTempFilePath: fail canvas is empty 这个错误,看起来是找不到自定义组件里面的 canvas
,这个有什么解决办法么?

@Airsola
Copy link
Author

Airsola commented Apr 8, 2019

测试了,使用原生的小程序的写法,this 传递 组件本身的引用是可以导出的对应图片的。不过我这是用了第三方框架megela,看来是megela这个框架的锅了...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant