• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Cpper
            C/C++高級(jí)工程師 Android高級(jí)軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語(yǔ)言 程序猿
            import QtQuick 2.9

            Item
            {
                visible: 
            true
                width: 
            1620
                height: 
            720
                id:background

                Image
                {
                    source: 
            "images/2560.png"
                    anchors.fill: parent
                }

                Flickable
                {
                    id: flick
                    anchors.top: parent.top;
                    anchors.left: parent.left
                    anchors.right: parent.right
                    anchors.bottom: parent.bottom
                    anchors.margins: 
            3
                    contentWidth: 
            0
                    contentHeight: 
            0
                    clip: 
            true

                    Image
                    {
                        id: image
                        smooth: 
            true
                        transformOrigin: Item.Center
                        source:
            "mark.png"

                        onStatusChanged:
                        {
                            
            if(status === Image.Ready)
                            {
                                image.width 
            *= 0.5
                                image.height 
            *= 0.5

                                image.x 
            = background.width*0.5-0.5*image.width
                                image.y 
            = background.height*0.5-0.5*image.height

                                
            /*mouseArea.drag.minimumX = 0
                                mouseArea.drag.maximumX = flick.width - image.width
                                mouseArea.drag.minimumY = 0
                                mouseArea.drag.maximumY = flick.height - image.height
            */
                            }
                        }
                    }
                }

                
            function makeImageCenter(imageWidth,imageHeight)
                {
                    
            var cx = image.x + 0.5*image.width
                    
            var cy = image.y + 0.5*image.height

                    image.width 
            = imageWidth
                    image.height 
            = imageHeight

                    image.x 
            = cx - image.width*0.5
                    image.y 
            = cy - image.height*0.5
                }

                MouseArea
                {
                    id: mouseArea
                    anchors.fill: flick
                    drag.target: image

                    onWheel:
                    {
                        
            var diff_w = 0.0
                        
            var diff_h = 0.0

                        
            if(wheel.angleDelta.y > 0)
                        {
                            diff_w 
            = image.width * 0.02
                            diff_h 
            = image.height * 0.02
                        }
                        
            else if(wheel.angleDelta.y < 0)
                        {
                            diff_w 
            = -image.width * 0.02
                            diff_h 
            = -image.height * 0.02
                        }
                        
            else
                        {
                            image.width 
            = width
                            image.height 
            = height
                        }

                        
            if(wheel.angleDelta.y != 0)
                            background.makeImageCenter(image.width
            +diff_w,image.height+diff_h)

                        drag.minimumX 
            = 0
                        drag.maximumX 
            = flick.width - image.width
                        drag.minimumY 
            = 0
                        drag.maximumY 
            = flick.height - image.height
                    }
                }
            }
            posted on 2019-08-20 13:53 ccsdu2009 閱讀(1520) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): QT編程
             
            2021久久精品国产99国产精品| 国产精品成人久久久久久久| 污污内射久久一区二区欧美日韩| 人妻丰满?V无码久久不卡| 四虎国产精品成人免费久久| 97久久综合精品久久久综合| 国产精品VIDEOSSEX久久发布| 久久无码AV中文出轨人妻| 狠狠干狠狠久久| 久久精品国产99国产精品导航| 77777亚洲午夜久久多喷| 精品久久久久成人码免费动漫 | 人人狠狠综合久久亚洲88| 久久男人AV资源网站| 久久精品国产亚洲AV香蕉| 日韩va亚洲va欧美va久久| 72种姿势欧美久久久久大黄蕉 | 久久精品一区二区影院| 久久精品国产2020| 亚洲精品国产综合久久一线| 99久久精品免费国产大片| 久久久亚洲欧洲日产国码二区| 无码人妻少妇久久中文字幕| 久久这里只精品国产99热| 新狼窝色AV性久久久久久| 久久福利资源国产精品999| 久久精品成人| 久久久久无码精品国产app| 精品国产91久久久久久久a| 亚洲成色999久久网站| 久久久亚洲欧洲日产国码aⅴ| 亚洲国产精品久久电影欧美| 久久久久久伊人高潮影院| 久久这里的只有是精品23| 中文字幕无码久久精品青草| 麻豆久久久9性大片| 欧美黑人激情性久久| 久久精品国产乱子伦| 亚洲国产精品久久电影欧美| 久久天天躁狠狠躁夜夜躁2O2O| 久久久久久人妻无码|