GDI/GDI+如何实现文字描边效果 Graphics g = e.Graphics; g.Clear(Color.Blue); GraphicsPath myPath = new GraphicsPath();
// Set up all the string parameters. string stringText = "测试文字觉得对方"; FontFamily family = new FontFamily("宋体"); int fontStyle = (int)FontStyle.Bold; int emSize = 20; Point origin = new Point(20, 20); StringFormat format = StringFormat.GenericDefault;
// Add the string to the path. myPath.AddString(stringText, family, 0, emSize, origin, format);
//Draw the path to the screen. e.Graphics.FillPath(Brushes.Black, myPath); e.Graphics.DrawPath(new Pen(Color.White), myPath);