按顺序复制
在wxml复制进去 照相机
<camera style="width: 100%; height: 500rpx;"></camera>
<button type="primary" bindtap="takePhoto">拍照</button>
<image style="width: 100%;" src="{
{src}}" ></image>
<button bindtap='saveToPhone'> 保存图片到本地</button>
js文件 复制进去
takePhoto:function(){
const ctx = wx.createCameraContext()
ctx.takePhoto({
quality: 'high',
success: (res) => {
console.log("拍照");

本文介绍了在小程序中如何使用照相机功能,并讨论了如何利用wx.getImageInfo和downloadFile进行图片处理。getImageInfo能处理各种类型的图片路径,而downloadFile专注于下载网络图片并提供下载进度等高级功能。
最低0.47元/天 解锁文章
4653

被折叠的 条评论
为什么被折叠?



