You can see this thread where this problem has been reported : Gdiplus Pen constructor change of behaviour in Windows 10 KB5006670 update
our company's C# based laser marking desktop applications display scaled up thick lines after the Windows update on October 12th. Pen width issue.
Our customers complain that our company's C# based laser marking desktop applications display scaled up thick lines after
the Windows update on October 12th. Removing the updates KB5006670 and KB5005539 causes applications to run normally.
This penomenon happens to our Legacy applications which is running on .Net 4 as well as current production version running on .Net 4.5.
After some experiments. we isolated the issue to the following code segments.
Our legagcy code as well as current codes create Pen objects with width 0 in the constructor as shown below.
That is how it has been since 2004.
When you run this code before and after the windows updates on October 10th, results are completely different.
Apperantly 0 penwidth has different meanings before and after the updates.
It shouldn't be that way and we don't have resources to modifty legacy codes to go with Microsofts updates.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.PageUnit = GraphicsUnit.Inch;
Pen penDraw = new Pen(Color.DarkRed, 0);
e.Graphics.DrawLine(penDraw, 1,1, 3, 3);
}
}
Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
2 additional answers
Sort by: Most helpful
-
Henning, Matthias 1 Reputation point
2021-10-15T07:08:43.76+00:00 -
Anton 36 Reputation points
2021-10-15T11:45:43.407+00:00 Apparently Microsoft has considered this as a bug and a team is working on it. Hopefully there will be an update.