Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Please help me
I have a rectangle with 4 names for 4 points.
Top left point is a,Top right point is b,
Bottom left point is c,Bottom right point is d.(it's not necessary to show these names in the form)I have this rectangle in my form,Now I want to draw another rectangle by rotating my first rectangle,I mean finally I should have 2 rectangles in my form.
please write the complete code with rotating commands,thanks.
Posted
Comments
Sergey Alexandrovich Kryukov 28-Dec-13 0:05am    
This is quite easy, but the answer will totally depend on what library you are using. System.Drawing is one things, WPF is another story (also will depend on which part of WPF you are using). Please provide more essential information, and you will get help real fast.
—SA

1 solution

Please see my comment to the question and clarify accordingly. However, as it's most likely that you are talking about System.Drawing, this is what you would need:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.transform%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.matrix%28v=vs.110%29.aspx[^] (in particular, see Rotate methods),
http://en.wikipedia.org/wiki/Rotation_matrix[^].

—SA
 
Share this answer
 

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