Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
3.00/5 (3 votes)
See more:
Hi,
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

----------------------------------------------------------------------
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.

Thanks
Posted
Updated 26-Nov-12 7:34am
v2
Comments
bbirajdar 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.
--SA
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.
--SA
Sergey Alexandrovich Kryukov 26-Nov-12 21:56pm    
(Sigh....)

I think the open book roughly looks like a fragment of a logarithmic spiral: http://en.wikipedia.org/wiki/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,
—SA
 
Share this answer
 
Comments
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.
Sergey Alexandrovich Kryukov 30-Nov-12 1:29am    
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?
--SA
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.
--SA
hi,
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.
 
Share this answer
 
Comments
Member 9496441 18-Feb-13 5:54am    
Hi,
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900