454,769 Members | 1,589 Online
Need help? Post your question and get tips & solutions from a community of 454,769 IT Pros & Developers. It's quick & easy.

# Non-proportional (non Rectangular) resizing

 P: n/a Hi all... I have developed an application for managing a very large resource of artist's paintings and posts them to a web site. The application works well. I'm trying to reduce the complexity of having to work with photoshop and integrate one feature into the application Distortion Transformations. Background Information: When paintings are photographed, it's impossible to get a completely perfect image that requires straightening prior to cropping for a number of rasons - the photographer is not standing square on to the painting, the painting is leaning, the camera is not at the correct height, the camera causes barrel distortion, etc... Therefore each image must be loaded into photoshop, all 4 corners selected using the polygonal lasso tool then manually applying a Distort Transformation (Edit Transform Distort) on the selected region. The Problem: The GDI library comes standard with several rectangular transformations - stretch, Skew, etc.. But these apply only to a perfect rectangular region where all points are perpendicular to each other. I have no problems in selecting the non-rectangular region - this is easy. I'm stumped at trying to work out how to take this region and applying the Photoshop like Distort Transformation. Anyone have any pointers? Thanks in advance... Graeme Jan 26 '07 #1
5 Replies

 P: n/a Transformations are all done using Matrix math. This is not going to be an easy task, because you will have to understand Matrix math to do it. Here are some articles and sample code to get you started: http://www.bobpowell.net/transformations.htm http://www.codeproject.com/csharp/ma...sformation.asp http://www.euclideanspace.com/maths/...etic/index.htm http://www.euclideanspace.com/maths/...ion_csharp.htm -- HTH, Kevin Spencer Microsoft MVP Software Composer http://unclechutney.blogspot.com The shortest distance between 2 points is a curve. "GraGra33"