1
我需要拉伸和挤压一定比例的图像,因为在下面的图像是可以做到这一点使用asp.net C#或有任何图像工具为此。只使用C#在某些坐标上压缩和拉伸图像
我需要拉伸和挤压一定比例的图像,因为在下面的图像是可以做到这一点使用asp.net C#或有任何图像工具为此。只使用C#在某些坐标上压缩和拉伸图像
找到该使用ImageMagick库的溶液中,它可以从here下载。
一旦参照Magick.net DLL已经添加可以使用以下代码来扭曲所述图像,
double[] Points = new double[] {
0,0, 0,0,
0,500, 50,500,
0,1000, 0,1000,
420,0, 420,0,
420,500, 370,500,
420,1000, 420,1000
};
MagickImage image = new MagickImage("E:/ImageManipulation/WebApplication2/images/Test.jpg");
image.Distort(DistortMethod.Shepards,Points);
image.Write("E:/ImageManipulation/WebApplication2/images/Result.jpg");
参见here为Shepards方法的一些例子