[Expand]General Information
[Collapse]WinForms Controls
 [Expand]What's Installed
 [Expand]Build an Application
 [Expand]Controls and Libraries
 [Collapse]Common Features
  [Expand]Data Binding Common Concepts
  [Expand]Data Source Wizard
  [Expand]Application Appearance and Skin Colors
  [Expand]Filtering UI Context
  [Collapse]High DPI Support
    DirectX Hardware Acceleration
    How To: Draw and Use SVG Images
  [Expand]Scaffolding Wizard
  [Expand]Formatting Values
   HTML Text Formatting
  [Expand]Tooltip Management
  [Expand]Saving and Restoring Layouts
   Clipboard - Copy and Paste Operations. Data Formatting
   Version Compatibility: Default Property Values
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

DirectX Hardware Acceleration

DirectX hardware acceleration allows your application to utilize a client machine's video card (integrated or dedicated) to render DevExpress controls. DirectX acceleration boosts applications' performance on 4K displays, where large data applications rendered with standard GDI+ can be unresponsive.

DirectX applications require the Windows 7 Platform Update (with DirectX 11), Windows 8 or newer. However, we do not recommend Windows 7 because it always returns DXGI_ERROR_INVALID_CALL when the CreateSwapChainForHwnd method is called. This causes the DirectX-rendered Data Grid to jitter when users resize the form.

Expanded Enable DirectX Hardware Acceleration

To enable DirectX rendering, call the static WindowsFormsSettings.ForceDirectXPaint method when the application starts.

Calling the ForceDirectXPaint method enables the DirectX hardware acceleration for the following controls:

To revert individual controls to the GDI+ engine, disable their UseDirectXPaint settings.

The following DevExpress controls' default UseDirectXPaint value is equal to DefaultBoolean.False. For these controls calling the static WindowsFormsSettings.ForceDirectXPaint method alone no effect. You should call the global static method and manually set their UseDirectXPaint properties to DefaultBoolean.True to enable the DirectX acceleration.

To use DirectX rendering in the PDF Viewer control, enable the PdfViewer.RenderPageContentWithDirectX property.

Expanded Hardware Recommendations


Applications benefit from DirectX acceleration on any display, but these advantages are more evident at higher resolutions (2K, WQHD, WQXGA, 4K, etc.).

Virtual Memory

DirectX rendering consumes more system resources than GDI+. If the application's virtual memory consumption rate reaches 1.8 (for x86-bit processors) or 2.6 (for x64-bit processors) gigabytes, the application automatically switches to the GDI+ engine to render new UI elements.

Expanded API Limitations

DirectX hardware acceleration imposes the following restrictions on the API:

Unsupported API
Recommended Action
All API accessed through the e.Graphics property (for example, when handling custom draw events). Utilize the GraphicsCache class API (available through the e.Cache property).
  • DirectX has no methods that accept image attributes. Instead, utilize the GraphicsCache methods that accept the ColorMatrix objects as parameters.
  • Methods that take Regions as parameters have no counterparts in GraphicsCache. Use methods that work with rectangles instead.
  • All GraphicsUnit enumeration values are treated as GraphicsUnit.Pixel.
Methods that use the Graphics class objects as parameters (for instance, the ControlPaint class methods). No replacement, use similar methods instead.
The AppearanceObject.CalcDefaultTextSize(Graphics g) method overload Replace with the AppearanceObject.CalcDefaultTextSize(GraphicsCache cache) overload
The following AppearanceObject.CalcTextSizeInt method overloads:
  • CalcTextSizeInt(Graphics g, StringFormat sf, string s, int width)
  • CalcTextSizeInt(Graphics g, string s, int width)
Replace with the following overloads:
  • CalcTextSizeInt(GraphicsCache cache, StringFormat sf, string s, int width)
  • CalcTextSizeInt(GraphicsCache cache, string s, int width)
The following AppearanceObject.CalcTextSize method overloads:
  • CalcTextSize(Graphics g, string s, int width)
  • CalcTextSize(Graphics g, StringFormat sf, string s, int width)
  • CalcTextSize(Graphics g, StringFormat sf, string s, int width, int height)
  • CalcTextSize(Graphics g, StringFormat sf, string s, int width, int height, out Boolean isCropped)
Replace with the following overloads:
  • CalcTextSize(GraphicsCache cache, string s, int width)
  • CalcTextSize(GraphicsCache cache, StringFormat sf, string s, int width)
  • CalcTextSize(GraphicsCache cache, StringFormat sf, string s, int width, int height)
  • CalcTextSize(GraphicsCache cache, StringFormat sf, string s, int width, int height, out Boolean isCropped)
The AppearanceObject.FontHeight property is obsolete No replacement for this property. Revisit your code and use a different approach.

To detect all the unsupported APIs, call the static WindowsFormsSettings.ForcePaintApiDiagnostics method and set the security level as the first parameter:

  • Throw - unsupported APIs result in exceptions;
  • Trace - unsupported APIs display result in warnings, displayed in Visual Studio's "Output" window;
  • Disable - ignores unsupported API;
  • Default - acts as "Trace" if DirectX and\or Per-Monitor HiDPI support is enabled; otherwise, as "Disable".

The ForcePaintApiDiagnostics method's second parameter allows you to specify a custom behavior:

Expanded Test Mode

DevExpress DirectX rendering is available only for graphics cards that support Direct3D Feature Levels equal to or higher than 11. To check your GPU's supported Feature Levels, run the "DirectX Diagnostic Tool": press "Win+R" to launch the "Run" dialog and type in the dxdiag command. Alternatively, in Visual Studio go to "Help | About Microsoft Visual Studio" and click the "DxDiag" button.

You can enable the Test Mode if your machine has Feature Levels of 10_2 or lower. This mode forces the application to use the DirectX rendering regardless of supported Feature Levels. Note that this mode is intended for debugging only.

Is this topic helpful?​​​​​​​