graphics 的DrawText 与graphicspath 的addstring的区别
来源:互联网 发布:波士顿动力 知乎 编辑:程序博客网 时间:2024/06/05 02:54
graphicspath 的addstring() 表示向此路径添加文本字符串。
然后用graphics的Drawpath()生成字体,发现是空心的。而用graphics的fillpath()生成的字体是实心的。
而这两个生成的字体不如用drawtext生成的字体看着好。必竟前者相当于填充画图。
Pen pen = new Pen(Color);
Brush b = new SolidBrush(Color);
StringFormat sf = new StringFormat();
sf.Trimming = StringTrimming.Word;
GraphicsPath gp = new GraphicsPath();
//gp.AddString(_theText, _font.FontFamily, (int)_font.Style, _font.SizeInPoints,
// new PointF(Rectangle.X, Rectangle.Y), StringFormat.GenericDefault);
gp.AddString(_theText, _font.FontFamily, (int)_font.Style, _font.SizeInPoints,
new RectangleF(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height), sf);
// Rotate the path about it's center if necessary
if (Rotation != 0)
{
RectangleF pathBounds = gp.GetBounds();
Matrix m = new Matrix();
m.RotateAt(Rotation, new PointF(pathBounds.Left + (pathBounds.Width / 2), pathBounds.Top + (pathBounds.Height / 2)),
MatrixOrder.Append);
// gp.Transform(m);
g.Transform = m;
}
//g.DrawString(_theText, _font, b, new PointF(Rectangle.X, Rectangle.Y),sf);
g.DrawString(_theText, _font, b, new RectangleF(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height), sf);
// g.DrawPath(pen, gp);
// g.FillPath(b, gp);
// rectangle.Size = g.MeasureString(_theText, _font).ToSize();
- graphics 的DrawText 与graphicspath 的addstring的区别
- c#中GraphicsPath的AddString方法
- flash Graphics与GraphicsPath的区别——填充方式的改变!
- Graphics类和GraphicsPath类的使用
- DrawText函数与TextOut函数的区别
- 取得GraphicsPath的源码
- gdi+ 的 graphicspath
- CListBox的AddString 排序问题
- CListBox的AddString 排序问题
- gdi+ 的 graphicspath (一)
- gdi+ 的 graphicspath (一)
- 关于GraphicsPath构造的问题
- Graphics的setClip与clipRect的区别
- Graphics的setClip与clipRect的区别
- Graphics.PageScale Graphics.ScaleTransform 的区别
- c#中GraphicsPath的Flatten方法
- c#中GraphicsPath的Widen方法
- c#中GraphicsPath的Warp方法
- 【模电】放大电路之频率响应
- AndroidManifest.xml文件剖析
- 注解的力量 -----Spring 2.5 JPA hibernate 使用方法的点滴整理(五):使用@Component 来简化bean的配置
- 注解的力量 -----Spring 2.5 JPA hibernate 使用方法的点滴整理(六): 一些常用的数据库 注解
- java取消科学计数法
- graphics 的DrawText 与graphicspath 的addstring的区别
- Eclipse中设置代理
- gstreamer中playbin的播放原理
- ADF中的 'pessimistic 锁' 和 'optimistic 锁'
- Linux进程间通信的方法
- mysql 查询慢分析
- hdu 2058 The sum problem
- 【sql server 2005】因使用关键字做为表名引起的Hibernate报错
- Android 从服务器下载文件