SurfaceImageSource class

Applies to Windows and Windows Phone

Provides Microsoft DirectX shared surfaces to draw into and then composes the bits into app content.

Inheritance

Object
  DependencyObject
    ImageSource
      SurfaceImageSource

Syntax


public class SurfaceImageSource : ImageSource

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The SurfaceImageSource class has these types of members:

Constructors

The SurfaceImageSource class has these constructors.

ConstructorDescription
SurfaceImageSource(Int32, Int32) Initializes a new instance of the SurfaceImageSource class, specifying the size of the drawing area.
SurfaceImageSource(Int32, Int32, Boolean) Initializes a new instance of the SurfaceImageSource class, specifying the size of the drawing area, and whether opacity is expected to be always full opacity. Use this with isOpaque=true if SurfaceImageSource should not support transparency; this can increase performance.

 

Methods

The SurfaceImageSource class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The SurfaceImageSource class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

 

Remarks

This class is a display area for DirectX interoperation whereby DirectX content can draw within an otherwise XAML-composed UI. One consideration for a SurfaceImageSource is that while it can incorporate the DirectX content, the rendering cycle is still XAML-centric. Too many DirectX draws in this render model can result in latency or poor responsiveness. If you anticipate a high number of redraws for your DirectX content, and you intend to display that content full-screen without any surrounding XAML UI, you probably should use the SwapChainBackgroundPanel technique instead. Another alternative for non-full-screen content is to render to a separate scratch surface on a background thread, then copy its contents to the surface returned from BeginDraw on the UI thread. This can unblock the UI thread at the cost of higher memory usage.

For more info on how to draw to a SurfaceImageSource, including sample code, see DirectX and XAML interop.

This class has additional APIs, but those APIs are for DirectX interoperation and are not part of the general app programming model otherwise described in this documentation. For example, from the DirectX side, you can call BeginDraw.

SurfaceImageSource derived classes

SurfaceImageSource is the parent class for VirtualSurfaceImageSource.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Imaging
Windows::UI::Xaml::Media::Imaging [C++]

Metadata

Windows.winmd

See also

DirectX and XAML interop
VirtualSurfaceImageSource
SwapChainBackgroundPanel
SurfaceImageSource sample

 

 

Show:
© 2014 Microsoft