C# 字符串笔刷与实体转换
时间:2020-12-21 11:02:48
收藏:0
阅读:0
--字符串转换为对象
Font vFont = new Font(new FontFamily(item.font_name), float.Parse(item.font_size), (FontStyle)Enum.Parse(typeof(FontStyle), item.font_style));
SolidBrush vBrush = new SolidBrush(Color.FromKnownColor((KnownColor)Enum.Parse(typeof(KnownColor), item.brush_color)));
--
g.DrawString(text, item.vFont,vBrush , rect, StringFormat.GenericDefault);
评论(0)