Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Expressions
  [Expand]Behaviors
  [Expand]Application Appearance
  [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]Menus
  [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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[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 employ a client machine's video card (integrated or dedicated) to render DevExpress controls. On 4K displays, where large data applications rendered with standard GDI+ become almost irresponsive, DirectX acceleration gives your applications an incredible speed boost (in our conducted tests - above 80 FPS (frames-per-second) on an i7-6700HQ@2.60GHz\16GB\GTX-960M laptop with a Dell S2817Q, 3840x2160@60Hz monitor attached).

Note that DirectX applications require Platform Update for Windows 7 (with DirectX 11), Windows 8 or newer installed on client machines.

Expanded Enable DirectX Hardware Acceleration

Call the static WindowsFormsSettings.ForceDirectXPaint method to enable DirectX hardware acceleration.

Expanded Supported Controls

The following DevExpress controls currently support this feature:

Expanded Recommendations

Displays

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 painting requires more system resources than GDI+ rendering, so the client machine must have enough virtual memory. If the application is close to 1.8 (for x86-bit processors) or 2.6 (for x64-bit processors) gigabytes of virtual memory consumption, new UI elements that need to be rendered revert to GDI+ drawing.

Expanded API Limitations

Enabling the DirectX hardware acceleration imposes a few restrictions on available API.

Unsupported API
Recommended Action
API accessed through the e.Graphics property, e.g. when handling custom draw events. Utilize the GraphicsCache class API instead (available through the e.Cache property).
  • DirectX has no methods that accept image attributes, so 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.
All methods that directly utilize Graphics objects as parameters (e.g., 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 try a different approach.

To trace all the unsupported APIs, utilize the WindowsFormsSettings.ForcePaintApiDiagnostics method and set the required security level as the first parameter:

  • Throw - an unsupported API results in throwing exceptions;
  • Trace - an unsupported API results 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 optional second parameter allows you to specify a custom behavior:

How would you rate this topic?​​​​​​​