ID2D1DeviceContext::SetTargetSurface method
Applies to: desktop apps | Metro style apps
Creates a bitmap and sets the bitmap as a target from a DXGI surface.
Syntax
void SetTargetSurface(
[in, optional] IDXGISurface *Surface
);
Parameters
Surface [in, optional]
Type: IDXGISurface*The DXGI surface to be set as the target.
Return value
This method does not return a value.
Remarks
This method allows the device context to target a DXGI surface. This is equivalent to calling CreateBitmapFromDxgiSurface followed by SetTarget. The created bitmap can be a source for drawing and a target bitmap. The alpha mode of the created bitmap will be D2D1_ALPHA_MODE_IGNORE. The DPI of the created bitmap will be (96,96). The created bitmap will inherit the bind flags of the DXG surface.
If Surface is NULL, this is equivalent to using SetTargetBitmap(NULL);
.
If the provided surface does not support being bound as a render target, the context will return D2DERR_BITMAP_IS_NOT_A_TARGET.
If the surface is not associated with the same device as this device context, the context will return D2DERR_WRONG_RESOURCE_DOMAIN.
Requirements
Minimum supported client |
Windows 8 Release Preview |
Minimum supported server |
Windows Server 2012 |
Header |
D2d1.h |
DLL |
D2d1.dll |
See also
ID2D1DeviceContext::CreateBitmapFromDxgiSurface
Send comments about this topic to Microsoft
Build date: 6/26/2012