The effect is as follows
The code is as follows
Private Image Loadfont (string pa)
{
Image Bmap;
Bmap = Image.FromFile (PA);
Graphics g = graphics.fromimage (BMAP);//Create Graphics object on Image Object
G.smoothingmode = Smoothingmode.antialias;
G.smoothingmode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
GraphicsPath MyPath = new GraphicsPath ();
String stringtext = This.textBox1.Text.Trim ();
string font = "";//font
This.comboBox1.Invoke (New EventHandler (delegate
{
Font = This.comboBox1.Text;
}));
FontFamily family = new FontFamily (Font);
int fontstyle = (int) fontstyle.bold;
int emsize = (int) numericupdown3.value;//font size
Point origin = new Point (10, 10);
StringFormat format = Stringformat.genericdefault;
Brush bru = new SolidBrush (Color.FromArgb (241, 027, 039));
Mypath.addstring (Stringtext,
Family
FontStyle,
Emsize,
Origin
format);
G.fillpath (Bru, MyPath);
G.drawpath (New Pen (Color.White, (float) numericupdown1.value), MyPath);
Bmap. Save (@ "d:/test.jpg");//saves image picture to local
return bmap;
}
Get all the fonts on the system
Installedfontcollection myfont = new Installedfontcollection ();
fontfamily[] myfontfamilies = myfont.families;
int Count = myfontfamilies.length;
for (int i = 0; i < Count; i++)
{
this.comboBox1.Items.Add (Myfontfamilies[i]. Name);
}