U
Ulaş Kayalar
Guest
Bitmap bmp = new Bitmap(1280, 720);
Graphics drawing = Graphics.FromImage(bmp);
Font stringFont = new Font(fontIsmi, 50);
SizeF stringSize = drawing.MeasureString("", stringFont);
drawing.DrawRectangle(new Pen(Color.Red, 1), 0.0F, 0.0F, stringSize.Width, stringSize.Height);
drawing.DrawString(yazdirilacakmetin, stringFont, Brushes.Red, new PointF(0, 0));
drawing.DrawImage(bmp, stringSize.Width, stringSize.Height);
bmp.Save(@"C:\Users\ulask\Folder\test.png", ImageFormat.Png);
bmp.Dispose();
I am printing in 1280x720 size. I want to print out the size of the text. But this code is not working correctly.
Continue reading...
Graphics drawing = Graphics.FromImage(bmp);
Font stringFont = new Font(fontIsmi, 50);
SizeF stringSize = drawing.MeasureString("", stringFont);
drawing.DrawRectangle(new Pen(Color.Red, 1), 0.0F, 0.0F, stringSize.Width, stringSize.Height);
drawing.DrawString(yazdirilacakmetin, stringFont, Brushes.Red, new PointF(0, 0));
drawing.DrawImage(bmp, stringSize.Width, stringSize.Height);
bmp.Save(@"C:\Users\ulask\Folder\test.png", ImageFormat.Png);
bmp.Dispose();
I am printing in 1280x720 size. I want to print out the size of the text. But this code is not working correctly.
Continue reading...