Bug Report T346466
Visible to All Users

DiagramControl disables DPI scaling for the entire application

created 9 years ago

[DevExpress Support Team: CLONED FROM T344944: How to automatically resize the diagram page to fit all generated shapes]

I managed to implement the solution but found a strange behaviour. When I run an application and open the diagram on a normal windows environment with scaling disabled everything works great. When I run the application and open the diagram on a windows machine where scaling is enabled the entire application window resizes to what it would be like with scaling disabled.

I attached an immage to try and show the problem better.

Regards,
Pablo.

Show previous comments (4)
Alex Chuev (DevExpress) 9 years ago

    Hi Juan and Ralf,

    We found that the issue occurs since the PresentationCore library used by DiagramControl affects the application DPI awareness in certain cases. As a temporary solution, make sure that the PresentationCore library is loaded before the main form is shown. You can do this by referencing any of the types declared in the PresentationCore library:

    C#
    static void Main() { var type = typeof(System.Windows.Input.Cursor); ...

    Thanks,
    Alex

    J J
    Juan Pablo Kuster 1 9 years ago

      Thanks Alexander,
      That actually solved the issue on my end, I hope that a permanent fix will come in the future releases of DevExpress.

      Regards,
      Pablo.

      Alex Chuev (DevExpress) 9 years ago

        I'm happy to hear that pre-loading the PresentationCore library resolves the issue on your side. Since the effect that the PresentationCore library has on DPI scaling is the default WPF behavior, a permanent fix requires removing dependencies to the PresentationCore library in the diagram code. Our developers are going to do further research to see if such dependencies can be removed without affecting DiagramControl's functionality.

        Thanks,
        Alex

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Additional information:

        Starting with version 16.1, the DevExpress.Diagram.Core library does not reference the PresentationCore library, which affects the DPI awareness for WinForms applications. Standard types from the PresentationCore library have been replaced with their DevExpress counterparts.

          Comments (2)
          JK JK
          Jacek Kosinski 8 years ago

            I still get this effect in 16.2.6

            Alexander Russkov (DevExpress) 8 years ago

              Hi Jacek,
              Please check if the PresentationCore assembly is added to your project references. If the PresentationCore library presence doesn't affect the issue, it would be great if you provide us with a sample project so that we can reproduce the issue and research it on our side.

              Thanks,
              Alexander

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.