PC Review


Reply
Thread Tools Rate Thread

Distort image shape

 
 
Peter Morris
Guest
Posts: n/a
 
      12th Apr 2009
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

 
Reply With Quote
 
 
 
 
Chris Taylor
Guest
Posts: n/a
 
      12th Apr 2009
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
--
Chris Taylor
http://taylorza.blogspot.com
http://dotnetjunkies.com/weblog/chris.taylor



"Peter Morris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy shape image into image control Luc Benninger Microsoft Excel Programming 3 21st Feb 2011 10:17 PM
Free transformation of image shape. oscar.holmberg@gmail.com Microsoft C# .NET 1 2nd Apr 2008 03:21 PM
Anyone know why the image in a filled shape disappears? =?Utf-8?B?UHVycGxl?= Microsoft Frontpage 4 4th Aug 2007 04:24 PM
What changes the control and image's shape? barbara_dave@yahoo.com Microsoft VB .NET 1 14th Sep 2005 10:53 PM
Fill Image in odd shape SStory Microsoft VB .NET 4 29th Jun 2004 09:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 AM.