Convert ID2D1Image to ID2D1Bitmap in Direct2D

thebluetropics 1,046 Reputation points
2022-10-06T04:52:56.727+00:00

Is there a way to get ID2D1Bitmap from an ID2D1Image?
ID2D1Effect::GetOutput() only returns ID2D1Image. I need ID2D1Bitmap, as it is feature rich.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,448 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,561 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jeanine Zhang-MSFT 9,261 Reputation points Microsoft Vendor
    2022-10-06T05:43:19.267+00:00

    @thebluetropice

    You could try to create a Bitmap (ID2D1DeviceContext::CreateBitmap) with D2D1_BITMAP_OPTIONS_TARGET flag, And then you could set and draw the effects output to this Bitmap.

    I suggest you could refer to the thread: https://stackoverflow.com/questions/31118397/direct2d-convert-id2d1image-to-id2d1bitmap

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful