is it possible that I can stretch side of a rectangle and change its shape from straight line to something else like arc or something by stretching it from center like shown below

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You probably wouldn’t want to use an arc as suggested by someone else, as an arc will only give you, well an arc. A better approach would be to represent your rectangle (4 sides) as 4 cubic beziers. A cubic bezier with control points that are collinear with the start and end points will produce a straight line, so you can still represent a normal rectangle. Then when you want to stretch the sides into a curve, you simply move the control points out, in, up or down depending on the curve you want. It would probably be beneficial to get a quick understanding of beziers.
I’ll make a picture to illustrate this better and include it in several minutes.
So when we draw our rectangle the code will look something like this: