带有矩阵变换的C#Bitmap类

时间:2017-10-30 17:51:48

标签: c# .net graphics bitmap coordinate-transformation

我正在使用矩阵类来剪切我的图像。但是如何计算新位图的预期宽度和高度?

Bitmap bitmap=new Bitmap(x,y);
Matrix matrix = new Matrix();
matrix.Shear(1, 0.2);            
Graphics graphics = Graphics.FromImage(bitmap);
graphics.Transform = matrix;
graphics.DrawImage(imageToSkew, 0, 0);
bitmap.Save(outputstream,imageformat);

0 个答案:

没有答案