| Previous | Next |
| D2DERR_PUSH_POP_UNBALANCED | D2DERR_INCOMPATIBLE_BRUSH_TYPES |
D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT
D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT means that the application attempted to copy from a render target while a layer or clipping rectangle was still active. Direct2D requires that temporary drawing state be unwound before that operation.
What to check
- Pop every active layer and clip before copying, reading back, or otherwise using the target in the restricted operation.
- Move the copy outside the scoped rendering helper that establishes the temporary state.
- Check error paths as well as the normal path for missing pops.
This error is solved by restoring target state, not by changing the copied pixels or destination rectangle.
Microsoft: Direct2D error codes
Looking for a different code? Search another status or error code.