How to save a ID2D1Bitmap to a file using WIC?

后端 未结 1 734
一向
一向 2021-01-25 09:39

I have a problem with saving a bitmap into a file. I\'m using How to save ID2D1Bitmap to PNG file as a reference, but I have a different error than the one posted in that.

相关标签:
1条回答
  • 2021-01-25 10:09

    Your understanding of resource affinity is insufficient. Resources are device-specific rather than factory-specific. Yes, they tend to be factory-specific as well, but the key is the device specificity.

    In your example, you are passing in a bitmap created by some other render target, which you then pass to the DrawBitmap method of a different render target. You may only draw a bitmap created by the same render target. This ensures that the bitmap and the render target (source and target) are in the same resource domain (address space).

    0 讨论(0)
提交回复
热议问题