gogoqaz
gogoqaz

Reputation: 182

How to retrieve pixel data from direct2D

How can I do this? If I apply some d2d effect, then how can I retrieve pixel data from it? just point out its rgba value.. I already survey the all d2d api, but can't find some relative api. Thanks!!

Upvotes: 1

Views: 1600

Answers (1)

zdd
zdd

Reputation: 8727

Direct2D does not provide the interfaces to manipulate pixels, but you can use WIC(Direct2D also use WIC to manipulate bitmaps) instead.

  1. Call ID2D1Factory::CreateWicBitmapRenderTarget to get the render target data, this function will return the IWICBitmap interface.
  2. Use Lock or CopyPixels methods from this interface to get the pixel data.

Upvotes: 1

Related Questions