15,615,787 members
1.00/5 (1 vote)
See more:
Hi All

I need to draw symmetric drawing on canvas control of xaml. please give me some tip and if possible example.

for reference:http://www.mathsisfun.com/geometry/symmetry-artist.html[^]

Thank You
Posted

## Solution 1

Well, if you want to make something similar to that link... that's way to wide to be explained in the quick answers section.

I recommend you to start on your own, when you got stuck then read What have you tried?[^] and come back here, edit your post using the widget "improve question" and then re-ask something more concrete. It will be easier for us to help you with that.

As an approach:
- You know how big your "drawing canvas" is, so you can mathematically divide it in sections depending on the simetry you choose.
The easiest ones are the inversion of axis and direction.
The difficult ones are the number of sections, you have to create them using the ecuation of a line knowing a point (your coordinates origin) and an angle (360 / number_of_axis). You can start with: http://www.mathsisfun.com/equation_of_line.html[^] and http://www.mathsisfun.com/algebra/line-equation-point-slope.html[^]

- To draw the symetry you have to use the OnMoveMouse, getting your current coordinate in pixels and doing the needed conversion, depending which symetry is activated. Save the "reflected" coordinates anywhere else and using them to draw the same you are doing with the mouse programatically. Logically, you will need so much temp_savers for your coordinates as refrexion axis are active.

I hope it gives you a bit orientation.

As I said, feel free to come back with more concrete questions about your code, when you have problems and the answers will be better (and easier for us to give)

v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 OriginalGriff 158 Richard MacCutchan 125 Dave Kreskowiak 40 Rick York 30 Richard Deeming 30
 OriginalGriff 3,124 Richard MacCutchan 1,381 Graeme_Grant 965 Dave Kreskowiak 689 CHill60 385

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