Distort image shape

P

Peter Morris

Hi all

I need to take an input image and produce an output image which is distorted
to fit 4 Points. So the 4 input points would be

(0,0)
(Width - 1, 0)
(Width - 1, Height - 1)
(0, Height - 1)

And the 4 output points would be anything the user decides, so that I can
have weirdly shaped output (e.g to look rotated + perspective).

I've Googled but can't find anything to do what I need. Does anyone have
any suggestions?


Pete
 
C

Chris Taylor

Hi,

Well, if you are using WPF you can use an ImageBrush and map the texture
coordinates from the image to the new shape provided by the user.

For windows forms GDI+ you will probably need to implement custom texture
mapping routine. Take a look at the following as a starting point
http://www.gamers.org/dEngine/rsc/pcgpe-1.0/texture.txt

Hope that helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top