d2dlib
d2dlib copied to clipboard
High DPI support
Currently, only support a default DPI 96, there should be APIs available to support variable DPI settings.
Related to #26
Added GetAPI
and SetDPI
method. https://github.com/jingwood/d2dlib/commit/ec1cd27df6094e5b041415a607343d27f36acc23
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?