question

MartinHusemann-6723 avatar image
23 Votes"
MartinHusemann-6723 asked AntonFernando-2151 commented

Gdiplus Pen constructor change of behaviour in Windows 10 KB5006670 update

When creating a Gdiplus Pen for a hair line we have always used 0.0 as witdh argument for the Pen constructor. With the KB5006670 this no longer works - the constructor changes the width from 0.0 to 1.0 (the default) and the width scales with various transformations - which is not what a hair line should do.

Explicitly setting the width (post construction) to 0 still works.

Is this a bug that will be fixed?

windows-api
· 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.

@MartinHusemann-6723, This issue should already be fixed, please update Windows to the latest version and let me know whether it works.

1 Vote 1 ·

We noticed that the latest Windows update has fixed the issue and, we have already informed our customers to update their computers.
Thank you for taking prompt actions; it was a life saver!

1 Vote 1 ·
XiaopoYang-MSFT avatar image
1 Vote"
XiaopoYang-MSFT answered Anton-3380 commented

KB5006670 release health does have a Microsoft Graphics Component update but It‘s probably not a bug. And It’s preferred to specify constructor parameter(s) directly instead of depending on default behavior.

· 6
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.

No, you misunderstood.

We have lots of code that does:

Gdiplus::Pen myPen(Color::Black, 0.0f);

and then uses myPen in a context where transformations apply.

Previously you could ask that pen for its width and get 0 back:

ASSERT(myPen.GetWidth()==0.0f);

but now this fails (GetWidth() returns 1.0f) and you have to explicitly call SetWidth(0.0f) to make it work like it did the last 10 or so years.

This breaks all our applications out in the wild and we only can recommend customers to back out the KB5006670 update for now.

So what I tried to say:

Gdiplus::Pen myPen(col, 0.0f) now behaves exactly like Gdiplus::Pen myPen(col) - ignoring its explicit width argument.

Breaking existing applications is not good. I guess not many apps rely on tiny lines or use pens in scaling contexts, or this would have shown up in textng upfront before rollout.

9 Votes 9 ·
Anton-3380 avatar image Anton-3380 MartinHusemann-6723 ·

This is definitely a bug! We have 15 year old applications and when Microsoft change their "preferences", we can not recompile those.

3 Votes 3 ·

OK, you should issue a bug. And can you find any problem in gdipluspen.h? I have no environment to verify.

0 Votes 0 ·

I can not see any problem in gdipluspen.h (has there been an update to that recently?)

How do I issue a bug? Can you escalate it to a bug?

0 Votes 0 ·

Yes, I will. Sorry, I didn't make it clear. You can issue a bug through Windows feedback hub.

0 Votes 0 ·

Workaround could be:

var pen = new Pen(color, width);
if (width==0)
pen.Width = 0;

0 Votes 0 ·
AlessandroOrdan-0311 avatar image
7 Votes"
AlessandroOrdan-0311 answered AlessandroOrdan-0311 published

The same thing for our software! Please solve this bug asap. We are getting assistance request from dozens of customers!

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.

MarkusH-6623 avatar image
8 Votes"
MarkusH-6623 answered DeThomasRichDISWEBSOPS-1347 commented

This is a serious problem for us because our desktop mapping-application produces totally wrong graphics-output since installing this update.

I reported a bug here: https://developercommunity.visualstudio.com/t/wrong-gdiplus-graphics-output-after-installing-kb5/1553998

· 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.

Looks like they closed your defect report.

0 Votes 0 ·
XiaopoYang-MSFT avatar image
0 Votes"
XiaopoYang-MSFT answered MartinHusemann-6723 commented

@MartinHusemann-6723 You should issue a bug through Windows Feedback Hub instantly. With the Feedback Hub link given, anyone who encounters the bug may vote it up and then we can process easily.

· 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.

DeThomasRichDISWEBSOPS-1347 avatar image
2 Votes"
DeThomasRichDISWEBSOPS-1347 answered

Unfortunately, My IT Department has disabled our ability to use the feedback hub so I can vote on it.

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.