WPF实现图像倾斜视差效果

实现效果如下:

思路:加载预设数量的Image控件,在鼠标移动时设置TranslateTransform的偏移量。

步骤:

1、MyImageControl2D自定义控件

布局:


交互逻辑:

        public static readonly DependencyProperty ShowImageProperty = DependencyProperty.Register("ShowImage", typeof(ImageSource), typeof(MyImageControl2D), new PropertyMetadata(null));
        public ImageSource ShowImage
        {
            get { return (ImageSource)GetValue(ShowImageProperty); }
            set { SetValue(ShowImageProperty, value); }
        }

        public int 

你可能感兴趣的:(WPF特效,WPF,图像倾斜)