Direct2D - Emulating Color Keyed Transparent Bitmaps

前端 未结 1 753
广开言路
广开言路 2021-02-10 04:52

I\'m currently updating a Windows GDI application to use Direct2D rendering and I need to support \"transparent\" bitmaps via color-keying for backwards compatibility.

R

相关标签:
1条回答
  • 2021-02-10 05:16

    If you only need to "process" the bitmap to render it, then the fastest is always GPU. In Direct2D there are effects (ID2D1Effect) for simple bitmap processing. You can write your own [it seems comparatively complicated], or use one of the built-in effects [which is rather simple]. There is one called chroma-key (CLSID_D2D1ChromaKey).

    On the other hand, if you need to do further processing on CPU, it gets more complex. You might be better off optimizing the code you have.

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