Andriy
Guest
|
|
Andrei Smolin
Add-in Express team
Posts: 18829
Joined: 2006-05-11
|
Hello Andriy,
Andriy writes:
We have tryied to set system DPI aware for thread that shows the dialogs
Instead, you should pass it the context returned by GetWindowDpiAwarenessContext(outlookMainWindow); get outlookMainWindow via GetActiveWindow(); this is Win API.
Andrei Smolin
Add-in Express Team Leader |
|
Andriy
Guest
|
Hi again, thank for the help.
We are facing another issue with scaling in Add-in express header.
1. We get Add-in Express header bounds in our override OnDrawHeader method.
2. We get Graphics object from ContainerControl.CreateGraphics() and can pain whole header red for example.
The problem is that when bounds scaled only part of header is colored. It looks Graphics.VisibleClipBounds shows us smaller are then it should be for drawing.
Can you help us scale our header? |
|
Andrei Smolin
Add-in Express team
Posts: 18829
Joined: 2006-05-11
|
Hello Andriy,
See the DrawArgs parameter of the OnDrawheader() method. It provides Graphics and Bounds.
Andrei Smolin
Add-in Express Team Leader |
|
Andriy
Guest
|
Hello,
I can use OnDrawHeader() method when the corresponding event is raised. But I need to get current Graphics object from ContainerControl at other moment of time, when header has already been drawn.
When my monitor scaling is default (100% in my case) then ContainerControl.CreateGraphics() works properly. But if scaling is changed (to 150%, for example) then ContainerControl.CreateGraphics() returns Graphics with reduced VisibleClipBounds.
Is it possible get Graphics object with correct VisibleClipBounds as OnDrawHeader() provides, but beyond the OnDrawHeader() method? |
|
Andrei Smolin
Add-in Express team
Posts: 18829
Joined: 2006-05-11
|
Hello Andriy,
You should use OnDraw as the header may be absent. This method is called whenever the container us draw; we think this method suits any need.
As far as we can see Graphics (and GDI+) doesn't work correctly with multiple DPIs. It works correctly with the DPI of the main monitor. When you use Graphics on another monitor, you'll still get information on the main monitor and you graphics won't draw correctly.
Andriy writes:
Is it possible get Graphics object with correct VisibleClipBounds as OnDrawHeader() provides, but beyond the OnDrawHeader() method?
No. We can't control it.
Andrei Smolin
Add-in Express Team Leader |
|