KB Article T590737
Visible to All Users

How to enable DirectX in PictureEdit

As you know, WinForms relies on GDI+ to render application content. Since GDI+ doesn't support hardware acceleration (your graphics card power), it becomes slow when rendering large areas at once  - it is especially noticeable when rendering large images or when working on large screens.
In version 17.2, we have implemented our own DirectX-based painting engine which supports hardware acceleration:

Major speed enhancements in WinForms grid (coming soon in v17.2)

In version 17.2, we implemented DirectX support in our GridControl only and are planning to extend this support in version 18.1. However, if you are ready to move your application to DirectX and don't want to wait for the official 18.1 release, you can try our new DirectX PictureEdit rendering engine in version 17.2. All you need to do is to download and install the latest build.

Take a look at this article to learn about changes you need to make in your application in order to move to the DirectX engine:

DirectX Hardware Acceleration

If you didn't heavily use the GDI+ Graphics  object, it won't require many changes.

To enable Direct X for PictureEdit, just add the following line to your form's constructor:

C#
pictureEdit1.UseDirectXPaint = DevExpress.Utils.DefaultBoolean.True;

That's it. Now, PictureEdit uses Direct X to render its image, instead of the default GDI engine.

Your feedback is greatly appreciated!

We would love to hear any feedback. If you like this feature, please let us know in comments below.
If you encounter any issue, feel free to create a separate ticket in our Support Center.

Looking forward to hearing from you!

Show previous comments (1)

    Also, why doesn't WindowsFormsSettings.ForceDirectXPaint() work for PictureEdit?

      Really cool feature. But I'm seeing some flickering of the PictureEdit background picture (shown as some null value) on mousehover/tooltip. Unfortunately Camtasia is unable to capture the flicker. I'm still trying to isolate the problem…

      DevExpress Support Team 7 years ago

        Hello Eaton and Alex,

        Thank you for your interest in this feature and your valuable feedback!

        When calling the ForceDirectXPaint method, we are using some kind of "smart" logic to determine which controls require DirectX and which don't. Currently, this logic is pretty simple - we enable DirectX for "heavy" controls like XtraGrid (XtraTreeList and XtraCharts in the future). For small controls like PictureEdit, we don't enable DirectX by default -  it makes sense to manually enable it when using large images only. In the future, we are also planning to provide more flexibility and allow our customers enable/disable DirectX for each supporting control (Grid, Tree List, Chart, etc.) individually.

        As for the issues you encountered, I've created separate tickets for each of them and we will do our best to resolve them as soon as possible:

        PictureEdit - An image is not displayed unless it is hovered when DirectX is enabled
        PictureEdit - The image background is black when DirectX is enabled
        PictureEdit - An image is flickering when DirectX is enabled

        Let me know if you have additional questions.

        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.