ID2D1RenderTarget interface
Represents an object that can receive drawing commands. Interfaces that inherit from ID2D1RenderTarget render the drawing commands they receive in different ways.
When to implement
Custom implementations are not supported.
Members
The ID2D1RenderTarget interface inherits from ID2D1Resource. ID2D1RenderTarget also has these types of members:
Methods
The ID2D1RenderTarget interface has these methods.
| Method | Description |
|---|---|
| BeginDraw |
Initiates drawing on this render target. |
| Clear | Overloaded. Clears the drawing area to the specified color. |
| CreateBitmap | Overloaded. Creates a Direct2D bitmap. |
| CreateBitmapBrush | Overloaded. Creates an ID2D1BitmapBrush from the specified bitmap. |
| CreateBitmapFromWicBitmap | Overloaded. Creates an ID2D1Bitmap by copying the specified Microsoft Windows Imaging Component (WIC) bitmap. |
| CreateCompatibleRenderTarget | Overloaded. Creates a new bitmap render target for use during intermediate offscreen drawing that is compatible with the current render target . |
| CreateGradientStopCollection | Overloaded. Creates an ID2D1GradientStopCollection from the specified array of D2D1_GRADIENT_STOP structures. |
| CreateLayer | Overloaded. Creates a layer resource that can be used with this render target and its compatible render targets. |
| CreateLinearGradientBrush | Overloaded. Creates an ID2D1LinearGradientBrush object for painting areas with a linear gradient. |
| CreateMesh |
Create a mesh that uses triangles to describe a shape. |
| CreateRadialGradientBrush | Overloaded. Creates an ID2D1RadialGradientBrush object that can be used to paint areas with a radial gradient. |
| CreateSharedBitmap |
Creates an ID2D1Bitmap whose data is shared with another resource. |
| CreateSolidColorBrush | Overloaded. Creates a new ID2D1SolidColorBrush that can be used to paint areas with a solid color. |
| DrawBitmap | Overloaded. Draws the specified ID2D1Bitmap. |
| DrawEllipse | Overloaded. Draws the outline of an ellipse with the specified dimensions and stroke. |
| DrawGeometry |
Draws the outline of the specified geometry using the specified stroke style. |
| DrawGlyphRun |
Draws the specified glyphs. |
| DrawLine |
Draws a line between the specified points using the specified stroke style. |
| DrawRectangle | Overloaded. Draws the outline of a rectangle that has the specified dimensions and stroke style. |
| DrawRoundedRectangle | Overloaded. Draws the outline of the specified rounded rectangle using the specified stroke style. |
| DrawText | Overloaded. Draws the specified text using the format information provided by an IDWriteTextFormat object. |
| DrawTextLayout |
Draws the formatted text described by the specified IDWriteTextLayout object. |
| EndDraw |
Ends drawing operations on the render target and indicates the current error state and associated tags. |
| FillEllipse | Overloaded. Paints the interior of the specified ellipse. |
| FillGeometry |
Paints the interior of the specified geometry. |
| FillMesh |
Paints the interior of the specified mesh. |
| FillOpacityMask | Overloaded. Applies the opacity mask described by the specified bitmap to a brush and uses that brush to paint a region of the render target. |
| FillRectangle | Overloaded. Paints the interior of the specified rectangle. |
| FillRoundedRectangle | Overloaded. Paints the interior of the specified rounded rectangle. |
| Flush |
Executes all pending drawing commands. |
| GetAntialiasMode |
Retrieves the current antialiasing mode for nontext drawing operations. |
| GetDpi |
Return the render target's dots per inch (DPI). |
| GetMaximumBitmapSize |
Gets the maximum size, in device-dependent units (pixels), of any one bitmap dimension supported by the render target. |
| GetPixelFormat |
Retrieves the pixel format and alpha mode of the render target. |
| GetPixelSize |
Returns the size of the render target in device pixels. |
| GetSize |
Returns the size of the render target in device-independent pixels. |
| GetTags |
Gets the label for subsequent drawing operations. |
| GetTextAntialiasMode |
Gets the current antialiasing mode for text and glyph drawing operations. |
| GetTextRenderingParams |
Retrieves the render target's current text rendering options. |
| GetTransform |
Gets the current transform of the render target. |
| IsSupported |
Indicates whether the render target supports the specified properties. |
| PopAxisAlignedClip |
Removes the last axis-aligned clip from the render target. After this method is called, the clip is no longer applied to subsequent drawing operations. |
| PopLayer |
Stops redirecting drawing operations to the layer that is specified by the last PushLayer call. |
| PushAxisAlignedClip | Overloaded. Specifies a rectangle to which all subsequent drawing operations are clipped. |
| PushLayer | Overloaded. Adds the specified layer to the render target so that it receives all subsequent drawing operations until PopLayer is called. |
| RestoreDrawingState |
Sets the render target's drawing state to that of the specified ID2D1DrawingStateBlock. |
| SaveDrawingState |
Saves the current drawing state to the specified ID2D1DrawingStateBlock. |
| SetAntialiasMode |
Sets the antialiasing mode of the render target. The antialiasing mode applies to all subsequent drawing operations, excluding text and glyph drawing operations. |
| SetDpi |
Sets the dots per inch (DPI) of the render target. |
| SetTags |
Specifies a label for subsequent drawing operations. |
| SetTextAntialiasMode |
Specifies the antialiasing mode to use for subsequent text and glyph drawing operations. |
| SetTextRenderingParams |
Specifies text rendering options to be applied to all subsequent text and glyph drawing operations. |
| SetTransform | Overloaded. Applies the specified transform to the render target, replacing the existing transformation. All subsequent drawing operations occur in the transformed space. |
Remarks
Your application should create render targets once and hold onto them for the life of the application or until the render target's EndDraw method returns the D2DERR_RECREATE_TARGET error. When you receive this error, you need to recreate the render target (and any resources it created).
Requirements
|
Minimum supported client |
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [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