当然如果将上述代码在变一下的话。就是另外一番风景啊~~
SizeF textSize ;
Graphics g;
Brush myBrush;
Single xLocation,yLocation;
Matrix myMatrix;
Font myFont = new Font("Times new Roman", 80, FontStyle.Bold);
g = pictureBox1.CreateGraphics();
g.Clear(Color.White);
string str = "Kevin";
textSize = g.MeasureString(str,myFont);
xLocation = (pictureBox1.Width/4)-5;
yLocation =(pictureBox1.Height/2-5);
g.TranslateTransform(xLocation,yLocation);
myMatrix = g.Transform;
myMatrix.Shear(1,0);
g.Transform = myMatrix;
myBrush=new HatchBrush(HatchStyle.DashedUpwardDiagonal,Color.Blue,Color.White);
g.DrawString(str,myFont,myBrush,0,0);
SizeF textSize ;
Graphics g;
Brush myBrush = Brushes.Blue;
Brush backBrush= Brushes.Gray;
Single xLocation,yLocation;
Font myFont = new Font("Times new Roman", 80, FontStyle.Bold);
g = pictureBox1.CreateGraphics();
g.Clear(Color.White);
string str = "Kevin";
textSize = g.MeasureString(str,myFont);
xLocation = (pictureBox1.Width/4)-5;
yLocation =(pictureBox1.Height/2-5);
g.DrawString(str,myFont,backBrush,(pictureBox1.Width/4),(pictureBox1.Height/2));
g.DrawString(str,myFont,myBrush,xLocation,yLocation);
这就是我想给各位的一个非常简单的操作文本程序。