d2dlib icon indicating copy to clipboard operation
d2dlib copied to clipboard

High DPI support

Open jingwood opened this issue 4 years ago • 2 comments

Currently, only support a default DPI 96, there should be APIs available to support variable DPI settings.

Related to #26

jingwood avatar Apr 30 '20 13:04 jingwood

Added GetAPI and SetDPI method. https://github.com/jingwood/d2dlib/commit/ec1cd27df6094e5b041415a607343d27f36acc23

jingwood avatar Sep 14 '20 16:09 jingwood

What is the correct usage of this? There seems to be no documentation.

My monitor is set to use 200% system DPI, and I had set the form's AutoScaleMode to Dpi. When I tried to draw a bitmap on a D2DControl by fitting the control and with correct aspect ratio, the image was big and clipped (only the second quadrant was showing). I kind of thought it could be some sort of DPI issue, but I could know how to fix it. So, I came here to ask if this is a bug, and saw this post.

With GetDPI, I get my monitor's DPI, which was 192/192. After seeing "Currently, only support a default DPI 96", I called SetDPI(96,96) and now the image looked correctly. But is this the correct way? Is that what you recommend that I should do in my situation?

HubKing avatar Aug 25 '21 17:08 HubKing