通过代码来学习
一起看下面的代码
using System;
using SystemCollectionsGeneric;
using SystemComponentModel;
using SystemData;
using SystemDrawing;
using SystemText;
using SystemWindowsForms;
using SystemDrawingDrawingD;
namespace advanced_drawing
{
public partial class Form : Form
{
public Form()
{
InitializeComponent();
}
private void Form_Paint(object sender PaintEventArgs e)
{
RectangleF rect = new RectangleF( );
StringFormat format = new StringFormat();
formatAlignment = StringAlignmentCenter;
formatLineAlignment = StringAlignmentCenter;
Matrix matrix = new Matrix();
matrixShear(f f);//只在X方向上Shear
matrixTranslate();
Graphics g=eGraphics;
gTransform = matrix;
gDrawString(zhuzhao thisFont BrushesBlue rect format);
gDrawRectangle(PensBlack rectX rectY rectWidth rectHeight);
}
}
}