C# Graphics 旋转270度后的对齐方向设置
当使用 RotateFlip 旋转 270 度时,对齐方向应该设置为 'BottomRight'。这是因为在旋转 270 度后,左上角变为了右下角,因此对齐方向也需要相应地调整。以下是示例代码:
// 创建一个 Graphics 对象
Graphics g = this.CreateGraphics();
// 旋转 270 度
g.RotateFlip(RotateFlipType.Rotate270FlipNone);
// 设置对齐方向为 BottomRight
g.TranslateTransform(this.ClientSize.Width, this.ClientSize.Height);
原文地址: https://www.cveoy.top/t/topic/oote 著作权归作者所有。请勿转载和采集!