Q-7-1. Do I have to free the bitmap after using dtShapeDoOutput?
Yes, if the bitmap_flag parameter is set to 1 (DV_BITMAP_ON), you should release it when it is no longer needed by calling dtBitmapFree.
Q-7-2. If, when calling dtShapeDoOutput, the bitmap_flag parameter is set to 0 (DV_BITMAP_OFF), do I still have to free the bitmap?
If the bitmap_flag parameter is set to 0, D-Type Shape Engine will never attempt to create a memory bitmap and will always provide a DV_NULL pointer for the bitmap data. Therefore, your application does not have to release memory by calling dtBitmapFree. To summarize, you should only release memory if the pointer to the bitmap data is not DV_NULL, which can only happen when bitmap_flag is set to 1 (DV_BITMAP_ON).