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.
When to implement
Custom implementations are not supported.
The ID2D1DeviceContext interface inherits from ID2D1RenderTarget. ID2D1DeviceContext also has these types of members:
The ID2D1DeviceContext interface has these methods.
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.
Creates a bitmap brush, the input image is a Direct2D bitmap object.
Creates a bitmap from a DXGI surface that can be set as a target surface or have additional color context information specified.
Creates a Direct2D bitmap by copying a WIC bitmap.
Creates a color context.
Creates a color context by loading it from the specified filename. The profile bytes are the contents of the file specified by Filename.
Creates a ID2D1CommandList object.
Creates an effect for the specified class ID.
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.
Creates an image brush. The input image can be any type of image, including a bitmap, effect, or a command list.
Draws a bitmap to the render target.
Draw a metafile to the device context.
Draws a series of glyphs to the device context.
Draws an image to the device context.
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.
Gets the device associated with a device context.
Gets the number of invalid output rectangles that have accumulated on the effect.
Gets the invalid rectangles that have accumulated since the last time the effect was drawn and EndDraw was then called on the device context.
Gets the maximum region of each specified input which would be used during a subsequent rendering operation.
Gets the world-space bounds in DIPs of the glyph run using the device context DPI.
Gets the bounds of an image without the world transform of the context applied.
Gets the bounds of an image with the world transform of the context applied.
Returns the currently set primitive blend used by the device context.
Gets the rendering controls that have been applied to the context.
Gets the target currently associated with the device context.
Gets the mode that is being used to interpret values by the device context.
This indicates that a portion of an effect's input is invalid. This method can be called many times.
Indicates whether the buffer precision is supported by the underlying Direct3D device.
Indicates whether the format is supported by the device context.
Push a layer onto the clip and layer stack of the device context.
Changes the primitive blend mode that is used for all rendering operations in the device context.
Sets the rendering controls for the given device context.
The bitmap or command list to which the Direct2D device context will now render.
Sets what units will be used to interpret values passed into the device context.
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.
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]|
- Devices and Device Contexts