• <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++高級工程師 Android高級軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語言 程序猿
            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 閱讀(1549) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            久久夜色精品国产亚洲| 久久中文骚妇内射| 久久综合九色综合久99| 99久久www免费人成精品| 久久久久18| 久久婷婷五月综合国产尤物app| 国产精品久久久久天天影视| 蜜臀久久99精品久久久久久| 久久亚洲中文字幕精品一区| 国内高清久久久久久| 久久精品九九亚洲精品天堂| 久久国产成人午夜AV影院| 亚洲人成网亚洲欧洲无码久久| 中文字幕成人精品久久不卡 | 久久青青草原亚洲av无码app| 91亚洲国产成人久久精品网址| 精品综合久久久久久98| 日本久久久久久久久久| 色综合久久中文综合网| 99久久国产热无码精品免费| 久久精品一区二区三区AV| 日本精品久久久久影院日本| 精品久久久无码中文字幕天天| 激情伊人五月天久久综合| 久久天天躁狠狠躁夜夜2020一| 色婷婷久久久SWAG精品| 国产精品免费久久| 亚洲天堂久久精品| 久久九九全国免费| 老司机国内精品久久久久| 狠狠色噜噜狠狠狠狠狠色综合久久| 久久精品亚洲一区二区三区浴池| 亚洲国产精品久久久天堂 | 久久99国产精品久久99小说 | 久久久久99精品成人片牛牛影视| 91精品国产91久久久久久| 亚洲天堂久久精品| 日韩AV毛片精品久久久| 久久人人爽人人爽人人片av麻烦 | 99久久99久久精品国产| 国产精品亚洲美女久久久|