private void GenerateLetterImagesFromFont(Int16 pixelSize)
{
return;
string fontName = "Sansation-Bold.ttf"; // font used by ARK
//ARKBreedingStats.Properties.Resources.Sansation_Bold;
fontName = System.Reflection.Assembly.GetExecutingAssembly().Location + @"\..\..\Resources\Sansation-Bold.ttf";
PrivateFontCollection pfcoll = new PrivateFontCollection();
//put a font file under a Fonts directory within your application root
pfcoll.AddFontFile(fontName);
FontFamily ff = pfcoll.Families[0];
string firstText = "Health: 2660.1 / 2660.1";
PointF firstLocation = new PointF(10f, 10f);
PointF secondLocation = new PointF(10f, 50f);
//put an image file under a Images directory within your application root
Bitmap bitmap = new Bitmap(300, 200);//load the image file
using (Graphics graphics = Graphics.FromImage(bitmap))
{
using (Font f = new Font(ff, pixelSize, FontStyle.Regular))
{
graphics.DrawString(firstText, f, Brushes.Red, firstLocation);
}
}
//save the new image file within Images directory
bitmap.Save(@"D:\Temp\test.png");
}