public static Bitmap DrawText(this Bitmap Image, string TextToDraw, Font FontToUse, Brush BrushUsing, RectangleF BoxToDrawWithin, string FileName = "") { Image.ThrowIfNull("Image"); FontToUse.ThrowIfNull("FontToUse"); BrushUsing.ThrowIfNull("BrushUsing"); BoxToDrawWithin.ThrowIfNull("BoxToDrawWithin"); ImageFormat FormatUsing = FileName.GetImageFormat(); Bitmap NewBitmap = new Bitmap(Image, Image.Width, Image.Height); using (Graphics TempGraphics = Graphics.FromImage(NewBitmap)) { TempGraphics.DrawString(TextToDraw, FontToUse, BrushUsing, BoxToDrawWithin); } if (!string.IsNullOrEmpty(FileName)) NewBitmap.Save(FileName, FormatUsing); return NewBitmap; }