How to increase the darkness of the text when printing in Win Form in C#

1.2k Views Asked by At

I'm trying to print a document in C#. However, the Black color of the text isn't good. It's dim. How can I adjust the quality of the text color in order to make it darker and clearer? Here is my code :

 Font font = new Font("Courier New", 18);
 SolidBrush brush = new SolidBrush(Color.Black);

 graphic.DrawString(DateTime.Now.ToString("dd/MM/yy"), font, brush,10,10);

Any help is appreciated ! Thanks !

2

There are 2 best solutions below

0
On BEST ANSWER

Instead of using Courier New, use another font like Arial Black or Copperplate Gothic Bold

0
On
//for more clearer rendering of text use
graphic.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;

//for darker font use BOLD font style
Font font = new Font("Courier New", 18,FontStyle.Bold);

So your code becomes

 graphic.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
 Font font = new Font("Courier New", 18,FontStyle.Bold);
 SolidBrush brush = new SolidBrush(Color.Black);

 graphic.DrawString(DateTime.Now.ToString("dd/MM/yy"), font, brush,10,10);