ID2D1DeviceContext interface (d2d1_1.h)

Represents a set of state and command buffers that are used to render to a target.

The device context can render to a target bitmap or a command list.

Inheritance

The ID2D1DeviceContext interface inherits from ID2D1RenderTarget. ID2D1DeviceContext also has these types of members:

Methods

The ID2D1DeviceContext interface has these methods.

 
ID2D1DeviceContext::CreateBitmap

Creates a bitmap that can be used as a target surface, for reading back to the CPU, or as a source for the DrawBitmap and ID2D1BitmapBrush APIs. In addition, color context information can be passed to the bitmap. (overload 1/2)
ID2D1DeviceContext::CreateBitmap

Creates a bitmap that can be used as a target surface, for reading back to the CPU, or as a source for the DrawBitmap and ID2D1BitmapBrush APIs. In addition, color context information can be passed to the bitmap. (overload 2/2)
ID2D1DeviceContext::CreateBitmapBrush

Creates a bitmap brush, the input image is a Direct2D bitmap object. (overload 4/4)
ID2D1DeviceContext::CreateBitmapBrush

Creates a bitmap brush, the input image is a Direct2D bitmap object. (overload 3/4)
ID2D1DeviceContext::CreateBitmapBrush

Creates a bitmap brush, the input image is a Direct2D bitmap object. (overload 2/4)
ID2D1DeviceContext::CreateBitmapBrush

Creates a bitmap brush, the input image is a Direct2D bitmap object. (overload 1/4)
ID2D1DeviceContext::CreateBitmapFromDxgiSurface

Creates a bitmap from a DXGI surface that can be set as a target surface or have additional color context information specified. (overload 2/2)
ID2D1DeviceContext::CreateBitmapFromDxgiSurface

Creates a bitmap from a DXGI surface that can be set as a target surface or have additional color context information specified. (overload 1/2)
ID2D1DeviceContext::CreateBitmapFromWicBitmap

Creates a Direct2D bitmap by copying a WIC bitmap. (overload 1/2)
ID2D1DeviceContext::CreateBitmapFromWicBitmap

Creates a Direct2D bitmap by copying a WIC bitmap. (overload 2/2)
ID2D1DeviceContext::CreateBitmapFromWicBitmap

Creates an ID2D1Bitmap by copying the specified Microsoft Windows Imaging Component (WIC) bitmap. (overload 1/4)
ID2D1DeviceContext::CreateColorContext

Creates a color context.
ID2D1DeviceContext::CreateColorContextFromFilename

Creates a color context by loading it from the specified filename. The profile bytes are the contents of the file specified by Filename.
ID2D1DeviceContext::CreateColorContextFromWicColorContext

Creates a color context from an IWICColorContext. The D2D1ColorContext space of the resulting context varies, see Remarks for more info. (ID2D1DeviceContext.CreateColorContextFromWicColorContext)
ID2D1DeviceContext::CreateCommandList

Creates a ID2D1CommandList object.
ID2D1DeviceContext::CreateEffect

Creates an effect for the specified class ID.
ID2D1DeviceContext::CreateGradientStopCollection

Creates a gradient stop collection, enabling the gradient to contain color channels with values outside of [0,1] and also enabling rendering to a high-color render target with interpolation in sRGB space.
ID2D1DeviceContext::CreateImageBrush

Creates an image brush. The input image can be any type of image, including a bitmap, effect, or a command list. (overload 2/3)
ID2D1DeviceContext::CreateImageBrush

Creates an image brush. The input image can be any type of image, including a bitmap, effect, or a command list. (overload 3/3)
ID2D1DeviceContext::CreateImageBrush

Creates an image brush. The input image can be any type of image, including a bitmap, effect, or a command list. (overload 1/3)
ID2D1DeviceContext::DrawBitmap

Draws a bitmap to the render target. (overload 2/5)
ID2D1DeviceContext::DrawBitmap

Draws a bitmap to the render target. (overload 4/5)
ID2D1DeviceContext::DrawBitmap

Draws a bitmap to the render target. (overload 3/5)
ID2D1DeviceContext::DrawBitmap

Draws a bitmap to the render target. (overload 1/5)
ID2D1DeviceContext::DrawGdiMetafile

Draw a metafile to the device context. (overload 1/3)
ID2D1DeviceContext::DrawGdiMetafile

Draw a metafile to the device context. (overload 2/3)
ID2D1DeviceContext::DrawGlyphRun

Draws a series of glyphs to the device context.
ID2D1DeviceContext::DrawImage

Draws an image to the device context. (overload 8/8)
ID2D1DeviceContext::DrawImage

Draws an image to the device context. (overload 1/8)
ID2D1DeviceContext::DrawImage

Draws an image to the device context. (overload 7/8)
ID2D1DeviceContext::DrawImage

Draws an image to the device context. (overload 2/8)
ID2D1DeviceContext::DrawImage

Draws an image to the device context. (overload 6/8)
ID2D1DeviceContext::DrawImage

Draws an image to the device context. (overload 4/8)
ID2D1DeviceContext::DrawImage

Draws an image to the device context. (overload 3/8)
ID2D1DeviceContext::DrawImage

Draws an image to the device context. (overload 5/8)
ID2D1DeviceContext::FillOpacityMask

Fill using the alpha channel of the supplied opacity mask bitmap. The brush opacity will be modulated by the mask. The render target antialiasing mode must be set to aliased. (overload 2/3)
ID2D1DeviceContext::FillOpacityMask

Fill using the alpha channel of the supplied opacity mask bitmap. The brush opacity will be modulated by the mask. The render target antialiasing mode must be set to aliased. (overload 1/3)
ID2D1DeviceContext::FillOpacityMask

Fill using the alpha channel of the supplied opacity mask bitmap. The brush opacity will be modulated by the mask. The render target antialiasing mode must be set to aliased. (overload 3/3)
ID2D1DeviceContext::GetDevice

Gets the device associated with a device context.
ID2D1DeviceContext::GetEffectInvalidRectangleCount

Gets the number of invalid output rectangles that have accumulated on the effect.
ID2D1DeviceContext::GetEffectInvalidRectangles

Gets the invalid rectangles that have accumulated since the last time the effect was drawn and EndDraw was then called on the device context.
ID2D1DeviceContext::GetEffectRequiredInputRectangles

Returns the input rectangles that are required to be supplied by the caller to produce the given output rectangle.
ID2D1DeviceContext::GetGlyphRunWorldBounds

Gets the world-space bounds in DIPs of the glyph run using the device context DPI.
ID2D1DeviceContext::GetImageLocalBounds

Gets the bounds of an image without the world transform of the context applied.
ID2D1DeviceContext::GetImageWorldBounds

Gets the bounds of an image with the world transform of the context applied.
ID2D1DeviceContext::GetPrimitiveBlend

Returns the currently set primitive blend used by the device context.
ID2D1DeviceContext::GetRenderingControls

Gets the rendering controls that have been applied to the context.
ID2D1DeviceContext::GetTarget

Gets the target currently associated with the device context.
ID2D1DeviceContext::GetUnitMode

Gets the mode that is being used to interpret values by the device context.
ID2D1DeviceContext::InvalidateEffectInputRectangle

This indicates that a portion of an effect's input is invalid. This method can be called many times.
ID2D1DeviceContext::IsBufferPrecisionSupported

Indicates whether the buffer precision is supported by the underlying Direct3D device.
ID2D1DeviceContext::IsDxgiFormatSupported

Indicates whether the format is supported by the device context.
ID2D1DeviceContext::PushLayer

Push a layer onto the clip and layer stack of the device context. (overload 2/2)
ID2D1DeviceContext::PushLayer

Push a layer onto the clip and layer stack of the device context. (overload 1/2)
ID2D1DeviceContext::SetPrimitiveBlend

Changes the primitive blend mode that is used for all rendering operations in the device context.
ID2D1DeviceContext::SetRenderingControls

Sets the rendering controls for the given device context. (overload 1/2)
ID2D1DeviceContext::SetRenderingControls

Sets the rendering controls for the given device context. (overload 2/2)
ID2D1DeviceContext::SetTarget

The bitmap or command list to which the Direct2D device context will now render.
ID2D1DeviceContext::SetUnitMode

Sets what units will be used to interpret values passed into the device context.

Remarks

Any resource created from a device context can be shared with any other resource created from a device context when both contexts are created on the same device.

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1_1.h

See also

D2D1CreateDeviceContext

Devices and Device Contexts

ID2D1Device::CreateDeviceContext

ID2D1RenderTarget