Windows 10 Update KB5006670 Breaks .Net Framework Pen Width

New Contributor

.Net Framework appears to have been upset by Windows update KB5006670. Previous to this update we were able to set a GDI+ Pen width to "-1", which would result in a 1px thick line regardless of zoom. After the update we're finding users are getting a scaled line thickness. We suspect the line units have been changed from Pixels to Points (resulting in the scaling of the line thickness). 

 

We've since issued an update in our software to account for this issue, but users running older versions of our software will still encounter it. 

 

Can anyone tell me how best to go about reporting this issue to Microsoft? 

5 Replies

@Niall_MS 

 

I have also used the -1 for pen width for some time. I was wondering if you have a snippet of code demonstrating how you fixed this?

 

Jon Sigler

@jon_sigler 

 

Hi Jon, we're now just calculating a 1px thick line based on the scale that we've set our picturebox to. It's not quite as nice, because if anti-aliasing is switched on we can end up with some slight blurring, whereas before it was nice and crisp. We could possibly switch anti-aliasing on and off between drawing various items, but I imagine there would be a performance hit.

@Niall_MS 

 

We have the same issue. Suddenly all lines in our application (using C# GDI+) do not scale correctly.

@ChrisEck 

 

Our fixes were fairly localized. Because of our scaling and the data we are presenting we were able to fix and test this rather quickly. I suspect @Niall_MS is verifying the source of the problem and that goodness of his fix just as we are:

 

1. We make sure that KB...6670 is installed and then test (very pronounced thick graph lines)

2. We remove KB..6670 and retest (graph lines are nice and thin)

3. Install the our new code with the fixes and retest with KB..6670 uninstalled. The nice thin lines are still present.

5. Install KB...6670 and retest with the updated code. The results very good. 

 

The changes with and without KB...6670 installed are fairly dramatic so it is very easy to test with our applications. However our changes in scaling causes us to do more testing (which has been done) but it goes quickly. Finally, as @Niall_MS said in his original post. This doesn't help with older installations.

 

@jon_sigler 

 

Thanks. We have fixed it too by setting pen.Width = 0 after calling the constructor. Not a big deal but the problem is all the old installations of our software. I really hope MS will fix this a.s.a.p.