Large images with Direct2D


  • Hello everybody. Currently I am developing application for the Windows Store which does real time-image processing using Direct2D. It must support various sizes of images. The first problem I have faced is how to handle the situations when the image is larger than the maximum supported texture size. After some research and documentation reading I found the VirtualSurfaceImageSource as a solution. The idea was to load the image as IWICBitmap then to create render target with CreateWICBitmapRenderTarget (which as far as I know is not hardware accelerated). After some drawing operations I wanted to display the result to the screen by invalidating the corresponding region in the VirtualSurfaceImage source or when the NeedUpdate callback fires. I supposed that it is possible to do it by creating ID2D1Bitmap (hardware accelerated) and to call CopyFromRenderTarget with the render target created with CreateWICBitmapRenderTarget  and the invalidated region as bounds, but the method returns E_INVALIDARG as a result. Another reason for using IWICBitmap is one of the algorithms involved in the application which must have access to update the pixels of the image.

    The question is why this logic doesn't work? Is this the right way to achieve my goal using Direct2D? Also as far as the render target created with CreateWICBitmapRenderTarget is not hardware accelerated if I want to do my image processing on the GPU with images larger than the maximum allowed texture size which is the best solution?

    Thank you in advance.

    • Edited by B. Dimitrov Wednesday, May 1, 2013 12:29 PM Provided additional information.
    Wednesday, May 1, 2013 12:18 PM


All replies