ID2D1Factory1::CreateDrawingStateBlock method
Creates a new drawing state block, this can be used in subsequent SaveDrawingState and RestoreDrawingState operations on the render target.
Syntax
HRESULT CreateDrawingStateBlock( [in, optional] const D2D1_DRAWING_STATE_DESCRIPTION1 *drawingStateDescription, [in, optional] IDWriteRenderingParams *textRenderingParams, [out] ID2D1DrawingStateBlock1 **drawingStateBlock );
Parameters
- drawingStateDescription [in, optional]
-
Type: const D2D1_DRAWING_STATE_DESCRIPTION1*
The drawing state description structure.
- textRenderingParams [in, optional]
-
Type: IDWriteRenderingParams*
The DirectWrite rendering params interface.
- drawingStateBlock [out]
-
Type: ID2D1DrawingStateBlock1**
The address of the newly created drawing state block.
Return value
Type: HRESULT
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
| HRESULT | Description |
|---|---|
| S_OK | No error occurred. |
| E_OUTOFMEMORY | Direct2D could not allocate sufficient memory to complete the call. |
| E_INVALIDARG | An invalid value was passed to the method. |
Examples
Here is an example of creating a ID2D1DrawingStateBlock1 with the primitive blend mode set to D2D1_PRIMITIVE_BLEND_SOURCE_COPY.
{
ID2D1DrawingStateBlock1 *pDrawingStateBlock = NULL;
IFR(pD2DDeviceContext->CreateDrawingStateBlock(
NULL,
NULL,
&pDrawingStateBlock
));
}
{
ID2D1DrawingStateBlock1 *pDrawingStateBlock = NULL;
D2D1_DRAWING_STATE_DESCRIPTION desc = D2D1::DrawingStateDescription1();
desc.primitiveBlend = D2D1_PRIMITIVE_BLEND_SOURCE_COPY;
IFR(pD2DDeviceContext->CreateDrawingStateBlock(
&desc,
NULL,
&pDrawingStateBlock
));
}
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 |
|
|
Library |
|
|
DLL |
|
See also