<image bindload="imgload" class="allimg" mode="widthFix" data-id="{{index}}" src='{{item[0]}}' bindtap="bindChooseType"></image>我怎么才能在点击bindChooseType的时候 获取当前点击的这张图片的宽高呢
<image bindload="imgload" class="allimg" mode="widthFix" data-id="{{index}}" src='{{item[0]}}' bindtap="bindChooseType"></image>我怎么才能在点击bindChooseType的时候 获取当前点击的这张图片的宽高呢
< imag ﹤ e ﹤ bindload = "imgload" class = "allimg" mode = "widthfix" data id = {{index}} "SRC = '{{item [0]}}' bindtap =" bindchoosetype "> < / Image > How can I get the width and height of the image I click on when I click bindchoosetype
回答:
bindload的时候就能获取到图片的宽高,存下来,点击的时候直接读取
点击的时候,把图片路径传过去,调用 wx.getImageInfo 就行了
原文出处:怎么点击获取图片宽高?
getImageInfo