Click here to Skip to main content
16,022,901 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i have few rectangles and i wand to draw them in one show but in different rotated angles
the Graphics.RotateTransform uses the same angle for all the drawing in the screen i want to separate them that each rectangle will have a different angle
Posted

1 solution

As simple (and naive) workaround, you may apply repeatedly the rotate transform. For instance, the following code (a little twist of the RotateTransform example on MSDN [^] ), draws two ellipses, rotated at different angles (namely 30° and 45°).
e.Graphics.RotateTransform(30.0F);
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
e.Graphics.RotateTransform(15.0F);
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);

:)
 
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