0

https://learn.microsoft.com/en-us/windows/desktop/direct2d/direct2d-transforms-overview seems to be clear in that "Direct2D supports only affine (linear) transformations"

But what if I have a need to transform an image to some arbitrary points what are my options in 2019? I note this has been asked before Mapping corners to arbitrary positions using Direct2D but that was in 2012 and I am wondering if there is any current option?

I had naively assumed that if I had a projective transform matrix (from cv::getPerspectiveTransform for instance) then things would work. Guess it pays to RTFM before diving into using Direct2D.

Alastair Taylor
  • 345
  • 1
  • 3
  • 10

1 Answers1

0

You can probably use effects to achieve that, for example CLSID_D2D13DPerspectiveTransform or CLSID_D2D13DTransform. I believe it acts as post processing, so you prepare your image, set it as input, and draw with selected effect.

bunglehead
  • 1,104
  • 1
  • 14
  • 22
  • Pretty certain those transforms don't do what I need so have gone down the rabbit hole of using OpenCV but the good news is I think I nearly have something that works. – Alastair Taylor Feb 20 '19 at 16:11
  • It supports custom effects too, that could apply any transform you need. – bunglehead Feb 20 '19 at 20:23