This is the special effect by the photoshop CS2 because it has an option to turn corner of the photograph, as I have done here.
Insert Picture: Take any picture as I have capture here.
Selection: Press Ctrl + A and Crtl + T then right click, choose "warp" as given below.
Adjustment: After selection of "warp" make adjustment of looking points.
It is your result.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.