Is there a way to distort an image using 4 points where the 4 points will correspond to the corners of an image?
Something like this:

Ignore the mid points and the center point. Here even though the image looks like it’s deformed in 3d, it’s not in my case. It’s just like modifying a 2d rectangle polygon on screen where the image that fills the rectangle conforms to the modified shape/polygon, since both has 4 vertices and 4 edges.
Any ideas on how to do this?
You can use Charles Petzold’s technique described here:
The second sample is a demo of exactly what you are describing.