Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID2D1Bitmap1::GetSurface method

Gets either the surface that was specified when the bitmap was created, or the default surface created when the bitmap was created.

Syntax


HRESULT GetSurface(
  [out, optional]  IDXGISurface **dxgiSurface
) const;

Parameters

dxgiSurface [out, optional]

Type: IDXGISurface**

The underlying DXGI surface for the bitmap.

Return value

Type: HRESULT

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

HRESULTDescription
S_OKNo error occurred.
D2DERR_BITMAP_BOUND_AS_TARGETCannot draw with a bitmap that is currently bound as the target bitmap.

 

Remarks

The bitmap used must have been created from a DXGI surface render target, a derived render target, or a device context created from an ID2D1Device.

The returned surface can be used with Microsoft Direct3D or any other API that interoperates with shared surfaces. The application must transitively ensure that the surface is usable on the Direct3D device that is used in this context. For example, if using the surface with Direct2D then the Direct2D render target must have been created through ID2D1Factory::CreateDxgiSurfaceRenderTarget or on a device context created on the same device.

Requirements

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1_1.h

DLL

D2d1.dll

See also

ID2D1Bitmap1
ID2D1RenderTarget::CreateSharedBitmap
ID2D1DeviceContext::CreateBitmapFromDxgiSurface
ID2D1DeviceContext::CreateBitmap

 

 

Community Additions

Show:
© 2015 Microsoft