本文主要是介绍QML实现PinchArea和MouseArea实现图片缩放和平移功能同时具备,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Image {id: photoImage//fillMode: Image.Pad //Image.Pad:原始图像不做处理source: (typeof picture_Scan_D_Area.pictureList[picture_Scan_D_Area.pictureIndex] === 'undefined') ? "" : picture_Scan_D_Area.pictureList[picture_Scan_D_Area.pictureIndex] //pictureIndex = 0smooth: truemipmap: trueantialiasing: trueComponent.onCompleted: { //它的存在就是在页面完成加载的时候,同时进行的操作x = parent.width / 2 - width / 2 //width:1180y = parent.height / 2 - height / 2 //height:770photoImage.scale = 80 / 100 // 让图片显示80%大小console.log("picture_Scan_D_Area.pictureList:",picture_Scan_D_Area.pictureList.length)}// Drag.active: mouseArea.drag.activePinchArea { //PinchArea 本身是一个不可见的 Item ,通常和一个可见的 Item 配合使用来处理捏拉手势,这里和
这篇关于QML实现PinchArea和MouseArea实现图片缩放和平移功能同时具备的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!