Tom*_*ght 0 c# graphics rotatetransform
我有以下功能:
static private Image CropRotate(Image wholeImage, Rectangle cropArea)
{
Bitmap cropped = new Bitmap(cropArea.Width, cropArea.Height);
using(Graphics g = Graphics.FromImage(cropped))
{
g.DrawImage(wholeImage, new Rectangle(0, 0, cropArea.Width, cropArea.Height), cropArea, GraphicsUnit.Pixel);
g.RotateTransform(180f);
}
return cropped as Image;
}
Run Code Online (Sandbox Code Playgroud)
它应该裁剪图像,然后旋转生成的子图像.但实际上,它只执行裁剪.
为什么RotateTransform()不被应用?
| 归档时间: |
|
| 查看次数: |
2830 次 |
| 最近记录: |