Click or drag to resize
AB4D logo

DXImage Class

DXImage is a control that is used to show the 3D scene with when the DirectXImage is used for the PresentationType property. The DXImage content can be mixed with other WPF elements (this is not possible when using D3DHost control.
Inheritance Hierarchy
SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.MediaVisual
        System.WindowsUIElement
          System.WindowsFrameworkElement
            System.Windows.ControlsImage
              Ab3d.DirectX.ControlsDXImage

Namespace: Ab3d.DirectX.Controls
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.1.9105.2048
Syntax
C#
public sealed class DXImage : Image, 
	IDisposable

The DXImage type exposes the following members.

Constructors
 NameDescription
Public methodDXImage Constructor
Top
Properties
 NameDescription
Public propertyEnableSoftwareFallback EnableSoftwareFallback specifies the value that is used for enableSoftwareFallback parameter in the call to the D3DImage.SetBackBuffer method. When it is set to true (by default) and .Net 4.5 version of DXEngine is used, then this allows using DXEngine with PresentationType set to DirectXImage over Remote Desktop. This property must be set before the back buffer in the D3D11ImageSource is created (usually before Loaded event).
Public propertyIsUsingD3DImage Gets a boolean that specifies if a D3DImage is used to show the content of this control. In this case the scene rendered with DirectX 11 stays in the GPU memory and is shared with WPF composition engine. When IsUsingD3DImage is false, the rendered DirectX 11 image is copied into main CPU memory and converted into a WritableBitmap.
Public propertyIsUsingWritableBitmap Gets a boolean that specifies if a WritableBitmap is used to show the content of this control. In this case the rendered DirectX 11 image is copied into main CPU memory and converted into a WritableBitmap. When IsUsingWritableBitmap is false, a D3DImage is used to show the image that is already stored in the GPU memory.
Top
Methods
 NameDescription
Public methodDispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodInitializeDXScene InitializeDXScene method must be called to connect the DXImage control to the DXScene that will render the DirectX scene. The method must be called after the DXScene is initialized and before the scene is rendered.
Public methodInvalidateD3DImage Refresh method updates the underlying D3D11ImageSource with marking it dirty so WPF will update it.
Public methodRecreateD3DImageSource RecreateD3DImageSource disposes the current D3DImageSource and creates a new instance of D3DImageSource. This method is internally called when the primary monitor is changed. This prevents crashes of WPF rendering thread. User may also manually call this method to prevent some similar problems (please also contact support@ab4d.com in such cases).
Public methodSetDpiScale Sets the Dpi scale that will be used by this DXImage
Top
Fields
 NameDescription
Public fieldDefaultSystemAdapterChangedAction DefaultSystemAdapterChanged event is triggered when the default system adapter (the primary system GPU) is changed. This means that it is not longer possible to share a DXEngine's texture with WPF. DXEngine will need to switch to WritableBitmap that is much slower than shared texture because the rendered scene needs to be copied from GPU memory to to CPU memory. In this case it is recommended to save the current scene, dispose the DXViewportView and create a new DXViewportView that will use the new graphics card.
Top
See Also