• Flex 图片缩放、托拽效果 Zoom版


    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  
        layout
    ="absolute"     width="1014" height="590" applicationComplete="app(event)" horizontalScrollPolicy="off" verticalScrollPolicy="off" verticalAlign="middle" horizontalAlign="center">
        
    <mx:Script>
            
    <![CDATA[
                import mx.events.EffectEvent;
                import mx.controls.Alert;
                import mx.events.FlexEvent;
                protected function app(event:FlexEvent):void
                {
                img.addEventListener(MouseEvent.MOUSE_DOWN, imgMouseDown);
                img.addEventListener(MouseEvent.MOUSE_UP, imgMouseUp);
                this.addEventListener(MouseEvent.MOUSE_WHEEL, imgZoom);
                }
                private function imgMouseDown(evt:MouseEvent):void
                {
                    evt.currentTarget.startDrag();
                }
                private function imgMouseUp(evt:MouseEvent):void
                {
                    evt.currentTarget.stopDrag();
                }
                private function imgZoom(evt:MouseEvent):void
                {
                    var w:Number = evt.delta;
                    var z:Number = fd.zoomHeightTo;
                    if(w > 0 && z < 3)
                    {
                        fd.stop();
                        fd.zoomHeightTo +=0.1;
                        fd.zoomWidthTo +=0.1;
                        fd.play();
                    }
                    if(w < 0 && z > 0.2)
                    {
                        fd.stop();
                        fd.zoomHeightTo -=0.1;
                        fd.zoomWidthTo -=0.1;
                        fd.play();
                    }

                }
                
            
    ]]>
        
    </mx:Script>
        
    <mx:Image y="123" id="img" source="1.jpg" x="257"/>
        
    <mx:Zoom id="fd" target="{img}"  zoomHeightTo="1"  zoomWidthTo="1" duration="600"/>  

    </mx:Application>
  • 相关阅读:
    python网络爬虫之使用scrapy自动爬取多个网页
    流畅的python学习笔记:第五章
    python cookbook第三版学习笔记 一
    python网络爬虫之scrapy 调试以及爬取网页
    python网络爬虫之scrapy 工程创建以及原理介绍
    流畅的python学习笔记:第三章
    python网络爬虫之LXML与HTMLParser
    python 解析docx文档的方法,以及利用Python从docx文档提取插入的文本对象和图片
    【原创】大数据基础之Drill(2)Drill1.14+Hive2.1.1运行
    【原创】大叔问题定位分享(12)Spark保存文本类型文件(text、csv、json等)到hdfs时为什么是压缩格式的
  • 原文地址:https://www.cnblogs.com/chixiaojin/p/2101959.html
Copyright © 2020-2023  润新知