D1234: Null Resource Brush

A bitmap brush or image brush may not be used for drawing when its associated bitmap/image is set to NULL.

 

Possible Causes

The application attempted to render a primitive using an ID2D1BitmapBrush or ID2D1ImageBrush whose bitmap or image was NULL.

Possible Fixes

Ensure that bitmap or image brushes have a valid bitmap or image assigned to them before using them. The application may do this at creation time or afterward, using ID2D1BitmapBrush::SetBitmap or ID2D1ImageBrush::SetImage. Direct2D allows NULL brush resources so that applications may have the freedom to release brush resources after using them to render. Applications may choose to do this if the bitmap or image resource is particularly costly, and the scenario demands it to be freed immediately. Setting a brush resource to NULL prevents Direct2D from keeping an outstanding reference to it. If an application does assign a brush resource to NULL, however, it should not attempt to use the brush until a new, valid resource has been assigned to it.