Click here to Skip to main content
13,087,566 members (94,733 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Need a help regarding how to bend/curve image in .net.It should look like open in a book.Does any body knows mathematical formula to do this.It should not be cropped should shrink or adjust its color also.
I have example for other transformation like wave,twist but not able to produce curved image at right or left side (at a time only one side).


Thanks for your help,
I need this in winforms (if possible wpf is also fine). Actually in application there is concept of book and there can be any image on both pages.Hence I needed this.I hope this will clarify my question more.

Posted 26-Nov-12 1:59am
Updated 26-Nov-12 7:34am
aspnet_regiis -i 26-Nov-12 9:32am
Wonderful question. But I cant answer it unless you tell me if you are coding for winforms or webforms...
Sergey Alexandrovich Kryukov 26-Nov-12 11:28am
Right. Also, it's not just "formula" -- please see my comment below.
amitnaik 26-Nov-12 13:36pm
its needed in winforms.I have improved my question.
Sergey Alexandrovich Kryukov 26-Nov-12 11:24am
How is it related to "curved" transform? Please read the question.
Sergey Alexandrovich Kryukov 26-Nov-12 21:56pm
Sergey Alexandrovich Kryukov 26-Nov-12 11:27am
Interesting question. I voted 4, because it needs some more information; it should better tag the library you would like to use (see the comment by aspnet_regiis). Also, "mathematical formula" is not a problem at all, the problem is how would you apply it. Most likely, you need it parametric, changing in animated motion, and it also requires sufficient performance...
amitnaik 27-Nov-12 15:03pm
Hi sergey.Thanks for your support,busy with my stuff.Yes i do need a parametric equation in terms of x and y (right now not thinking about animation stuff). I am thinking about curve line(y=ax^3+bx^2+cx+d) but getting somehow stiff slope, need smooth curve and what do u think about elliptical equation?
Sergey Alexandrovich Kryukov 27-Nov-12 17:44pm
I see now. Well, this is something much easier. What physical behavior should it model. Really, an open book?
amitnaik 27-Nov-12 15:22pm
I think parabolic formula in Cartesian format will do the job.but dont know how it will handle all x axis all +ve points.can't find proper coefficients.plz help, if u know.
Sergey Alexandrovich Kryukov 27-Nov-12 17:50pm
I thinks it's much closer to logarithmic spiral. Please see my answer.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I think the open book roughly looks like a fragment of a logarithmic spiral:[^].

Open a book and you will see it; the center of the spiral will be near the point where the pages are attached. And it's very simply described parametrically, especially in polar coordinates.

Good luck,
amitnaik 30-Nov-12 0:56am
Hi SA.thanx for your help.I managed to find solution to get curve image after spending hours in different geometrical equations.
But i didn't got idea of how to use spiral equation to map source image pixel to target image(curved) pixel.
Soon will post solution and if possible article too.I will definitely look into WPF book control also.Thanks for help.
Actual shape is more complex, but is the pages are not too long, it looks like the spiral. After all, open a book and see... still cannot see it?
amitnaik 30-Nov-12 3:40am
Got your point SA. I will definitely try to implement if i come across such requirement for this in future.
Sergey Alexandrovich Kryukov 30-Nov-12 13:59pm
Great. Will you formally accept the answer then (green button)? -- thanks.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

for solving this i tried many geometrical equation but was not able to relate with image pixel position.So what i did is, start at particular angle say 30 deg for left most pixel and then using Tan formula (trignometry) to get elevated 'y' pixel then just started dropping initial angle till right most pixel.repeat this for each line of image.
This way i got my required curve image.
Though as per sergey (SA's) solution , we can also use spiral equation with proper inputs not implemented yet.
Thanks all guys who posted their comments.
Member 9496441 18-Feb-13 5:54am
I am searching for the same solution. I need a curved image (eg. a Image printed on pen), how can I achieve this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100