Exemple #1
0
 static Stream BuildTextImage(string strText,
                              Color color,
                              int nWidth = 400)
 {
     // 文字图片
     return(ArtText.BuildArtText(
                strText,
                "Consolas", // "Microsoft YaHei",
                (float)16,
                FontStyle.Bold,
                color,
                Color.Transparent,
                Color.Gray,
                ArtEffect.None,
                ImageFormat.Png,
                nWidth));
 }
Exemple #2
0
 // 文字图片
 public static MemoryStream TextImage(
     ImageFormat image_format,
     string strText,
     System.Drawing.Color text_color,
     System.Drawing.Color back_color,
     float fFontSize = 10,
     int nWidth      = 300)
 {
     return(ArtText.BuildArtText(
                strText,
                "Microsoft YaHei",
                fFontSize,
                FontStyle.Regular,
                text_color,
                back_color,
                Color.Gray,
                ArtEffect.None,
                image_format,
                nWidth));
 }