Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GDI: How to skew an image in perspective?

Status
Not open for further replies.

EdwardJS024

Programmer
Nov 24, 2004
82
US
Hi guys,
Maybe someone can help me. Hopefully this post is clear. I know everyone is busy with their own work. Thanks in advance a thousand times.

MY OBJECTIVE:
I want to skew an image in a quadrilateral perspective. To get an example of what the image shape is supposed to be like after skewing, look at the [Isosceles Trapezoid] picture on this page (3rd one down):


MY PROBLEM:
I am only able to skew into a parrellogram shape.[8o|] I understand that Graphics.DrawImage() can skew an image by accepting an array of 3 destination Points (top-left, top-right, bottom-left), but somehow I need to specify the 4th Point cause right now it is interpolated from the three. Because I can only specify 3 points in the array, my image does not look like an Isosceles Trapezoid in perspective, it looks more like a parrellogram (see 4th one down on example page above).

SOLUTION?
I am pretty new to GDI/transformations/translations so a small example on how to do this in c#(preferred) or vb.net would be helpful. Thank you.

Thank you guys,
-EJS
 
Have you looked into the Shear method? This will make parallelograms, but for a true "perspective" you may not be able to accomplish this using the 2d Methods provided by GDI.

You will have to look into Direct X for .Net, its quite a bit more complicated, but you will be able to get true 3d perspectives.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top