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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to distort selected parts of an image?

Status
Not open for further replies.

planix

Technical User
Dec 3, 2002
22
Hi,

This is a conceptual question, at this point. No code.

I am developing software to use in research to evaluate people's body image, and particularly trying to assess self image distortions. Some software that I have seen, but not used, allows subjects to distort portions of an image of themselves (ie. upper arms, chest, trunk, hips, upper legs, and thighs).

I have had a quick play with doing something like this. It is easy to distort the entire image using Stretch, but I would like to try and make the process more fine grained.

Can somebody point me in the direction of any reading, or example code, that would allow the user to selectively distort regions of an image?

Thanks

Alistair Campbell
JCU
Australia
 
If you know the regions you want to play with then you can copy areas of an image and put them in a seperate image which you can then distort and copy back.

Drop 2 TImage components on a form.
Load an image into 1 of them.
Drop a button onto the form.
Put the following code on button click

Code:
  image2.Canvas.CopyRect(rect(0,0,100,100),image1.Canvas,rect(0,0,100,100));

Run the program and on button click a 100 square area will be copied from image1 to image 2.

Robertio
Alias: Robbie Calder
Software Developer
urc@walkermartyn.co.uk
 
Thanks Robbie. I guess that I can also keep one image hidden so that the distortion looks like it is happening within the one picture.

The next step would be to stretch the image2, by whatever amount, and then use the same copy code back into image1, right?

I will give this a go and then come back with code for more ideas.

Thanks again.

Alistair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top