Skip to content

Fix PrinterSettings.SupportsColor to use the right PInvoke - #34651

Merged
safern merged 6 commits into
dotnet:masterfrom
safern:PrinterFixSupportsColor
Apr 15, 2020
Merged

Fix PrinterSettings.SupportsColor to use the right PInvoke#34651
safern merged 6 commits into
dotnet:masterfrom
safern:PrinterFixSupportsColor

Conversation

@safern

@safern safern commented Apr 7, 2020

Copy link
Copy Markdown
Member

According to MS docs, GetDeviceCaps(BITSPIXEL) returns the "Number of adjacent color bits for each pixel."

We instead need to use DeviceCapabilities with DC_COLORDEVICE

Fixes: #34630

cc: @ericstj @tarekgh

@ghost

ghost commented Apr 7, 2020

Copy link
Copy Markdown

Tagging @safern as an area owner

Comment thread src/libraries/System.Drawing.Common/src/System/Drawing/Gdiplus.cs
Comment thread src/libraries/System.Drawing.Common/tests/Printing/PrinterSettingsTests.cs Outdated

@Tanya-Solyanik Tanya-Solyanik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some nit comments. Please take a look.

@safern

safern commented Apr 15, 2020

Copy link
Copy Markdown
Member Author

It seems like the Mono Build node didn't update in the GH UI, but the build is green: https://dev.azure.com/dnceng/public/_build/results?buildId=600616&view=logs

Merging.

@safern
safern merged commit 4265a13 into dotnet:master Apr 15, 2020
@safern
safern deleted the PrinterFixSupportsColor branch April 15, 2020 01:10
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrinterSettings.SupportsColor should use DeviceCapabilities(DC_COLORDEVICE) instead of GetDeviceCaps(BITSPIXEL).

5 participants