zoukankan      html  css  js  c++  java
  • 图片放大器——wpf

    <Grid>
                            <Image x:Name="imgSource" Source="{Binding WebPath}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40">
                                <!--Tag="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}" -->
                                <!--<Image.RenderTransform>
                                    <ScaleTransform x:Name="scaleTrans" CenterX="20" CenterY="20"/>
                                </Image.RenderTransform>-->
                               
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="MouseEnter">
                                        <i:InvokeCommandAction Command="{Binding MouseEnterFeedFileCommand}" CommandParameter="{Binding}"/>
                                    </i:EventTrigger>
                                    <i:EventTrigger EventName="MouseLeave">
                                        <i:InvokeCommandAction Command="{Binding MouseLeaveFeedFileCommand}" CommandParameter="{Binding}"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </Image>
                        </Grid>

    private void MouseEnterFeedFile(object obj) {     if (MouseEnterFeedFileEvent != null)     {         MouseEnterFeedFileEvent(this);     }

        //ScaleTransform scaleTrans = new ScaleTransform { CenterX = 20, CenterY = 20 };     //Image img = obj as Image;     //if (img != null)     //{             //    Panel.SetZIndex(img, 9);     //    img.RenderTransform = scaleTrans;     //    scaleTrans.ScaleX += 5;     //    scaleTrans.ScaleY += 5;     //} }

    private void MouseLeaveFeedFile(object obj)
    {
        if (MouseLeaveFeedFileEvent != null)
        {
            MouseLeaveFeedFileEvent(this);
        }
        //Image img = obj as Image;
        //if (img != null)
        //{
        //    Panel.SetZIndex(img, 0);
        //    ScaleTransform scaleTrans = img.RenderTransform as ScaleTransform;
        //    if (scaleTrans != null)
        //    {
        //        scaleTrans.ScaleX -= 5;
        //        scaleTrans.ScaleY -= 5;
        //    }
        //}
    }

  • 相关阅读:
    手工卸载.Net写的win服务
    程序员素质面试题
    GridView数据导出功能
    使用EventLog类写系统日志
    HTML Response ContentType 大全
    用C#做短信CMPP2.0/3.0协议 支持扩展号支持物理网卡
    CYQ.Data 轻量数据层之路 使用篇MAction 数据查询 视频 E (二十二)
    CYQ.Data 轻量数据层之路 V2.0 震撼惊世 支持多数据库/内置Aop(二十五)
    MapXtreme 2005 GIS开发入门系列 索引
    CYQ.Data 轻量数据层之路 框架如何应对数据库变化
  • 原文地址:https://www.cnblogs.com/changbaishan/p/4604840.html
Copyright © 2011-2022 走看看