How do I scale a high quality bitmap in Direct2D?

I am trying to move an application from GDI + to Direct2D for performance reasons.

Perviously I have used StretchBlt () in HALFTONE mode which gives big but slow results.

Now I am drawing Direct2D using RenderTarget-> DrawBitmap (), but it only has two modes, LINEAR and NEAREST_NEIGHBOR, which are not very good. LINEAR is better, but it still produces terrible artifacts.

Does Direct2D have any high quality scaling options? If not, is it better for me to stick with GDI or is there another option? It is a Windows application that runs in a window with various Win32 controls.

+3


source to share


1 answer


Direct2D 1.0 only supports linear and nearest neighbor interpolation. Direct2D 1.1 adds four additional interpolation algorithms. They are available through the new target of rendering the device context ( ID2D1DeviceContext

) and its methods DrawBitmap

and DrawImage

. Look at the enumeration D2D1_INTERPOLATION_MODE

:



http://msdn.com/library/hh447004.aspx

+7


source







All Articles