C# WPF 图片旋转、放大、扭曲、平移、不透明蒙版等
- 资源大小:71.54 kB
- 上传时间:2021-06-29
- 下载次数:0次
- 浏览次数:1次
- 资源积分:1积分
-
标 签:
C#源码
资 源 简 介
这是一个C#图像处理程序,把一张图片平移、顺时针角度旋转、按一定角度扭曲、使用不透明蒙版等功能,以下是实现具体功能的代码,把这些处理功能封装到按钮事件中:
private void button2_Click(object sender, RoutedEventArgs e)
{//缩放图像
if (this.button2.Content=="放大图像")
{
ScaleTransform MyScaleTransform = new ScaleTransform();
MyScaleTransform.CenterX = this.image1.Width / 2;
MyScaleTransform.CenterY = this.image1.Height / 2;
MyScaleTransform.ScaleX = 1.5;
MyScaleTransform.ScaleY = 1.5;
this.image1.RenderTransform = MyScaleTransform;
this.button2.Content = "缩小图像";
}else{
ScaleTransform MyScaleTransform = new ScaleTransform();
MyScaleTransform.CenterX = this.image1.Width / 2;
MyScaleTransform.CenterY = this.image1.Height / 2;
MyScaleTransform.ScaleX = 0.5;
MyScaleTransform.ScaleY = 0.5;
this.image1.RenderTransform = MyScaleTransform;
this.button2.Content = "放大图像";
}
}
private void button3_Click(object send
文 件 列 表
srcfans.com
I099
MyWPF
App.xaml.cs
I099
I099
MyWPF
App.xaml
srcfans.com