C#中Shear的用法实例
程序员文章站
2023-11-21 16:12:34
本文实例讲述了c#中shear的用法。分享给大家供大家参考。具体如下:
using system;
using system.collections.gener...
本文实例讲述了c#中shear的用法。分享给大家供大家参考。具体如下:
using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.text; using system.windows.forms; using system.drawing.drawing2d; namespace advanced_drawing { public partial class form8 : form { public form8() { initializecomponent(); } private void form8_paint(object sender, painteventargs e) { rectanglef rect = new rectanglef(0, 0, 100, 50); stringformat format = new stringformat(); format.alignment = stringalignment.center; format.linealignment = stringalignment.center; matrix matrix = new matrix(); matrix.shear(.5f, 0f);//只在x方向上shear matrix.translate(200,0); graphics g=e.graphics; g.transform = matrix; g.drawstring("zhuzhao", this.font, brushes.blue, rect, format); g.drawrectangle(pens.black, rect.x, rect.y, rect.width, rect.height); } } }
希望本文所述对大家的c#程序设计有所帮助。
上一篇: redis 基础(一)
下一篇: 导出 mysql 数据到 redis