I am generating ID cards via .NET and I am having a problem where the dynamic text I insert appears so blurry that I have to use a bold font for it to be begrudgingly accepted.
What I'm currently doing:
- Grab the image "frame".
- Grab the employee's photograph.
- Merge them.
- Create a new bitmap from the generated image.
- Add two sets of text on top of the bitmap (FontBrush color set to Black).
- Save the image in
PNG
and with the highest quality I can get.
Is there something to be done when generating the image to improve the printing on PVC ID cards?
public TextOnImage AddText(string message, Font font, PointF point)
{
using (Graphics g = Graphics.FromImage(Image))
{
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
//g.TextContrast = 0;
//g.TextRenderingHint = TextRenderingHint.AntiAlias; <-- Still didn't work
g.DrawString(message, font, Brush, point, StringFormat);
}
return this;
}