Large images with Direct2D

折月煮酒 提交于 2019-11-30 23:24:08

You are correct that images larger than the texture limit must be handled in software.

However, the question to ask is whether or not you need that entire image every time you render.

You can use the hardware accel to render a portion of the large image that is loaded in a software target.

For example,

  • Use ID2D1RenderTarget::CreateSharedBitmap to make a bitmap that can be used by different resources.
  • Then create a ID2D1BitmapRenderTarget and render the large bitmap into that. (making sure to do BeginDraw, Clear, DrawBitmap, EndDraw). Both the bitmap and the render target can be cached for use by successive calls.
  • Then copy from that render target into a regular ID2D1Bitmap with the portion that will fit into the texture memory using the ID2D1Bitmap::CopyFromRenderTarget method.
  • Finally draw that to the real render target, pRT->DrawBitmap
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!