question

Anton-3380 avatar image
0 Votes"
Anton-3380 asked Anton-3380 answered

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-10-application-compatibility
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is this behaviour specific to particular graphics devices?
Do you see the same problem in safe mode?
I suspect you'll need to contact MS support (phone) to progress this.

0 Votes 0 ·

Fix is quite easy

Just add

penDraw.Width = 0

Behaves as before.

0 Votes 0 ·
Castorix31 avatar image
1 Vote"
Castorix31 answered

You can see this thread where this problem has been reported : Gdiplus Pen constructor change of behaviour in Windows 10 KB5006670 update


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HenningMatthias-7308 avatar image
0 Votes"
HenningMatthias-7308 answered HenningMatthias-7308 commented
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Anton-3380 avatar image
0 Votes"
Anton-3380 answered

Apparently Microsoft has considered this as a bug and a team is working on it. Hopefully there will be an update.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.