提交 a9c742d4 编写于 作者: DCloud-yyl's avatar DCloud-yyl

解决logo图圆角毛刺的问题

上级 421fac61
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<button class="uni-btn btn-TakeSnapshot" type="primary" @tap="takeSnapshotClick"> <button class="uni-btn btn-TakeSnapshot" type="primary" @tap="takeSnapshotClick">
点击截图并替换显示下方图片 点击截图并替换显示下方图片
</button> </button>
<image style="margin-top: 20px;" :src="snapImage" mode="aspectFit" @longpress="saveToAlbum"></image> <image style="margin-left:auto;margin-right:auto;margin-top:20px;width:90%;" :src="snapImage" :mode="mode" @longpress="saveToAlbum"></image>
</view> </view>
</template> </template>
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
export default { export default {
data() { data() {
return { return {
mode: "center",//aspectFit
snapImage: "/static/uni.png" snapImage: "/static/uni.png"
} }
}, },
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
success: function (res) { success: function (res) {
console.log(res.tempFilePath) console.log(res.tempFilePath)
this.snapImage = res.tempFilePath this.snapImage = res.tempFilePath
this.mode = 'widthFix'
uni.showToast({ uni.showToast({
title: '截图成功,路径:' + res.tempFilePath, title: '截图成功,路径:' + res.tempFilePath,
icon: "none" icon: "none"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view style="flex:1"> <scroll-view style="flex:1">
<!-- #endif --> <!-- #endif -->
<image src="/static/uni.png" style="margin: 30rpx 200rpx;height:350rpx;width: 350rpx;"></image> <image src="/static/uni.png" style="margin: 30rpx 200rpx;height:196px;width:196pxpx;"></image>
<button style="margin: 30rpx;" @click="saveImage">将图片保存到手机相册</button> <button style="margin: 30rpx;" @click="saveImage">将图片保存到手机相册</button>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
...@@ -39,4 +39,4 @@ ...@@ -39,4 +39,4 @@
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
static/uni.png

4.1 KB | W: | H:

static/uni.png

4.2 KB | W: | H:

static/uni.png
static/uni.png
static/uni.png
static/uni.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册