+6  A: 

All of the example images you posted can be done with a Quadrilateral Distortion. Though I cant say for certain that a quad distort will cover ALL non affine transforms.

Heres a link to a not so good implementation of it in C#... it works, but is slow. Poke around Wikipedia for the many different optimizations available for these kinds of calculations

http://www.vcskicks.com/image-distortion.html

-Neil

Neil N
"Though I cant say for certain that a quad distort will cover ALL non affine transforms." It won't, there are many, many things a quad distort can't do. But it's an excellent start.
kquinn
+4  A: 
Coincoin
No, we got an iPod, and i saw the page-wrap-up ability. And i was disgusted that a tiny embedded device, and flash, can no fancy transformations - but a Core2 Duo running the most advanced operating system in the world cannot.
Ian Boyd
"...can do* fancy transformations..."
Ian Boyd
Just because it doesnt have built in functions to do fancy transforms doesnt mean it can't do it. I've seen some pretty amazing graphics doen in pure C#
Neil N
With the link Neil provided you, you can do what you want. It will do good 3D, although not perspective correct, but it should not matter if your polygons stay small.
Coincoin
Actually the link I provided WOULD allow for perspective correct transforms, if used properly.
Neil N
If used on sufficiently small polygons and the user provides perspective corrected mappings herself, yes you can achieve a similar effect. But from what I can see, the library as-is do not provide perspective corrected mapping.
Coincoin
"From what you can see" ?? how about being sure before making false statements. The linked algorithm computes EACH PIXEL, no need to break it up into polygons.
Neil N
Neil N: The algorithm is a quad mapper, what it does is affine mapping. With only 2D coordinates, there is no way this is doing perspective correct mapping. If you still have doubt after this comment, I invite you to do research on what "perspective correct texture mapping" is.
Coincoin
Coincoin, calculating corner intersection is a perspective correct method. It may not be the method you are familiar with, but it works. You can even test it against other perspective correct methods, you will not see any difference. This is a fact.
Neil N
I updated my answer to give more details about the problems that might arise if simple distortions are used versus perspective corrected. As you can see, I tested the library against a perspective correct method (DirectX) and the difference is clear.
Coincoin
Now, I know there are ways to have perspective without resorting to a full 3D system, assuming we have a source rectangle and a target quad, however, the library just doesn't seem to do it, unless I missed something
Coincoin
My mistake, I assumed because it used corner intersection that it was correct. After looking deeper, it uses it incorrectly.
Neil N
And this is still a very useful answer, as you took the time to post a picture showing the difference between a distortion and a perspective correction. In my case i was wanting to do a perspective correction - taking what looks like a flat piece of paper and having it rotated
Ian Boyd
A: 

You can do this in wpf using a the Viewport3d control and a non-affine transform matrix. Rendering this to a bitmap again may be interesting.... Which I "fixed" by including an invisible <image> control with the same image as on my textured plane... (Also, I've had to work around the max texture size issues by splitting up the plane and cropping images...)

http://www.charlespetzold.com/blog/2007/08/060605.html

In my case I wanted the reverse of this (transform so arbitrary points on the warped become the corners of my rectangular window), which is the Inverse of the matrix to do the opposite.

sphereinabox
Oh, Charles Petzold also posted how to do this in silverlight 3 using the Matrix3dProjection: http://www.charlespetzold.com/blog/2009/07/Using-the-Matrix3DProjection-Class-in-Silverlight-3.html
sphereinabox