public void Write_Text_On_Bitmap(ref Bitmap src_Bitmap, string txtDateTime, Point Location) // write text on Bitmap
{
try
{
Point Text_Location = new Point(Location.X, Location.Y);
using (Graphics graphics = Graphics.FromImage(src_Bitmap))
{
Rectangle rect = new Rectangle((Location.X - 160), (Location.Y - 3), 405, 40);
graphics.DrawRectangle(new Pen(Color.White), rect);
graphics.FillRectangle(Brushes.White, rect);
using (Font TahomaFont = new Font("B Nazanin", 18, FontStyle.Bold)) // create text font
{
graphics.DrawString(txtDateTime, TahomaFont, Brushes.Red, Text_Location); // draw text on bitmap
graphics.Dispose();
}
}
}
catch
{
// throw;
}
}