This article discusses about what and most effective solutions to fix Windows Error D2DERR_BITMAP_BOUND_AS_TARGET, also known as 0x88990025, -2003238875, and 2291728421. D2DERR_BITMAP_BOUND_AS_TARGET error means cannot draw with a bitmap that is currently bound as the target bitmap.
Error Information
Error Number/Return Code/Error Code Value
HEX: 0x88990025
Signed Integer/Dec: -2003238875
Unsigned Integer: 2291728421
What is Windows Error D2DERR_BITMAP_BOUND_AS_TARGET 0x88990025, -2003238875, 2291728421?
Constant Name/Result String/String Error: D2DERR_BITMAP_BOUND_AS_TARGET
Error Message Description
- Cannot draw with a bitmap that is currently bound as the target bitmap.
- 対象のビットマップとして現在バインドされているビットマップで描画することはできません。
Category: HRESULT
HRESULT is a data type numerical error codes used in Windows operating systems, and the earlier IBM/Microsoft OS/2 operating system, to represent error conditions, and warning conditions, prevent collisions between error codes in different subsystems of the OS/2 operating system at the same time. Various bits within an HRESULT encode information about the nature of the error code. HRESULT error codes are commonly used in COM programming, where they form the basis for a standardized COM error handling convention.
HRESULT analysis
flags: SX; facility: 2201 (FACILITY_DIRECT2D); error: 37
- Flags/Severity: Failure
- Flags/Reserved (R): false
- Flags/Origin: Microsoft
- Flags/NTSTATUS: false
- Flags/Reserved (X): true
- Facility/Code: 2201 (0x899)
- Facility/Name: FACILITY_DIRECT2D
- Error Code: 37 (0x0025)
- Facility: DLS
- Operating System: Windows
Where does Windows Error D2DERR_BITMAP_BOUND_AS_TARGET 0x88990025, -2003238875, 2291728421 come from?
Windows Error D2DERR_BITMAP_BOUND_AS_TARGET 0x88990025, -2003238875, 2291728421 declared in the following source:
- winerror.h from Windows SDK 10.0.14393.0
- COM-based APIs Error Codes (UI, Audio, DirectX, Codec)
- Direct 2D (hardware accelerated GUI rendering) > FACILITY_DIRECT2D
Value: 2201 | 0x899 | 0b100010011001 - Error code definitions for the Win32 API functions
pub const D2DERR_BITMAP_BOUND_AS_TARGET: HRESULT = 0x88990025 - PythonForWindows > generated Windows defines and structures
windows.generated_def.D2DERR_BITMAP_BOUND_AS_TARGET = D2DERR_BITMAP_BOUND_AS_TARGET(0x88990025) - GO windows package
D2DERR_BITMAP_BOUND_AS_TARGET Handle = 0x88990025 - Xbox One Kernelbase.dll
0x88990025, “Cannot draw with a bitmap that is currently bound as the target bitmap.\r\n” - danmar/cppcheck/cfg/windows.cfg
<define name=”D2DERR_BITMAP_BOUND_AS_TARGET” value=”0x88990025″/> - RattletraPM/Snickerstream/include/Direct2DConstants.au3
Global Const $D2DERR_BITMAP_BOUND_AS_TARGET = 0x88990025 ;You can’t draw with a bitmap that is currently bound as the target bitmap. - Google Git > go / sys / refs/heads/master / . / windows / zerrors_windows.go
D2DERR_BITMAP_BOUND_AS_TARGET Handle = 0x88990025 - “Fossies” – the Fresh Open Source Software Archive > Member “cppcheck-2.8.2/cfg/windows.cfg” (12 Jul 2022, 840860 Bytes) of package /linux/misc/cppcheck-2.8.2.tar.gz:
<define name=”D2DERR_BITMAP_BOUND_AS_TARGET” value=”0x88990025″/> - twitchapon-anim > zerrors_windows.go (678909B)
D2DERR_BITMAP_BOUND_AS_TARGET Handle = 0x88990025
How to fix Windows Error D2DERR_BITMAP_BOUND_AS_TARGET 0x88990025, -2003238875, 2291728421?
Question/Problem Description
When I am trying to draw offscreen to CanvasRenderTarget using another CanvasRenderTarget which was drawn to from the previous draw call as the input to a PixelShaderEffect. However instead of newing up a PixelShaderEffect each draw I have the same effect created once because I am using a CanvasAnimatedControl with game loop. On the second draw call I get the exception error:
'Cannot draw with a bitmap that is currently bound as the target bitmap. (Exception from HRESULT: 0x88990025)'
Solution
The exception error 0x88990025 means you are trying to draw using the rendertarget as source image at the same time as you are in the middle of drawing onto it as the destination. You can only do one of these things at a time.
Perhaps you are scoping your drawing sessions in such a way that they overlap.
The source is the render target on second invocation. The Solution is to create two render targets, on tick draw to target1 using target2 as effect source which is initialised as effect source, then vice-versa on tock.