c# - WPF - Canvas optimisation solution -
i have trouble wpf project. better understood, have big drawing spaces in archicad - drawed many electrical components (motors, cable, serrated wheel, gears, electrical plates , other). export project adobe illustrator (.ai), , import file blend. example small gear have code :
<canvas x:name="_30_gear_left_no__1" height="234" canvas.left="67" canvas.top="243" width="476"> <path data="m7.208,0.334l6.814,0.466 6.393,1.557 6.312,1.881 5.237,1.253 4.777,1.451 2.15,3.027c1.727,3.495 1.358,4.007 1.049,4.556 0.654,5.323 0.38,6.146 0.236,6.996l0.184,7.649c0.17,8.048 0.238,8.446 0.384,8.817 0.535,9.162 0.773,9.461 1.075,9.686l0.507,10.253 0.507,10.713 1.461,11.243 0.901,12.29 1.033,12.553 2.018,13.144 1.953,13.538 4.581,15.049 4.898,14.702 5.894,15.312 6.288,15.312 6.843,14.276 7.799,14.786 8.193,14.589 8.589,13.111 9.77,13.406 10.099,13.078 10.033,11.633 10.468,11.213 11.478,11.37 11.807,10.91 11.214,10.013 11.28,9.728 12.791,8.874 12.988,8.414 12.069,7.691 12.069,7.56 13.449,6.377 13.514,5.918 12.526,5.362 13.449,4.144 13.317,3.75 12.397,3.225 12.66,2.436 12.463,2.239 8.981,0.269 8.653,0.203 8.127,0.86z" height="15.495" canvas.left="-0.182" strokestartlinecap="round" strokeendlinecap="round" stroke="black" strokethickness="0.368" strokelinejoin="round" canvas.top="-0.203" width="13.714"/> <path data="m7.207,0.334l6.813,0.466 6.392,1.557 6.311,1.881 5.236,1.253 4.776,1.451 2.149,3.027c1.726,3.495 1.357,4.007 1.047,4.556 0.653,5.323 0.379,6.146 0.235,6.996l0.183,7.649c0.17,8.048 0.237,8.446 0.383,8.817 0.534,9.162 0.772,9.461 1.074,9.686l0.506,10.253 0.506,10.713 1.46,11.243 0.9,12.29 1.032,12.552 2.017,13.144 1.952,13.538 4.579,15.049 4.897,14.702 5.893,15.311 6.287,15.311 6.842,14.275 7.798,14.786 8.192,14.589 8.588,13.111 9.769,13.406 10.097,13.078 10.032,11.633 10.467,11.213 11.477,11.37 11.806,10.911 11.213,10.013 11.28,9.728 12.79,8.874 12.988,8.414 12.068,7.691 12.068,7.56 13.448,6.378 13.513,5.918 12.526,5.362 13.448,4.144 13.316,3.751 12.396,3.225 12.659,2.436 12.462,2.239 8.98,0.269 8.652,0.203 8.126,0.86z" height="15.494" canvas.left="277.517" strokestartlinecap="round" strokeendlinecap="round" stroke="black" strokethickness="0.368" strokelinejoin="round" canvas.top="174.475" width="13.714"/> <path data="m7.207,0.333l6.813,0.464 6.392,1.556 6.311,1.88 5.236,1.252 4.776,1.45 2.148,3.026c1.726,3.494 1.357,4.006 1.047,4.555 0.653,5.322 0.379,6.145 0.234,6.995l0.183,7.648c0.169,8.047 0.237,8.444 0.383,8.816 0.534,9.161 0.772,9.46 1.074,9.685l0.506,10.252 0.506,10.712 1.46,11.242 0.9,12.289 1.032,12.551 2.017,13.143 1.952,13.537 4.579,15.048 4.897,14.701 5.893,15.31 6.287,15.31 6.842,14.274 7.798,14.785 8.192,14.588 8.588,13.11 9.769,13.405 10.097,13.077 10.032,11.632 10.467,11.212 11.477,11.369 11.806,10.91 11.213,10.012 11.279,9.727 12.79,8.873 12.987,8.413 12.068,7.69 12.068,7.559 13.448,6.376 13.513,5.917 12.525,5.361 13.448,4.143 13.316,3.75 12.396,3.224 12.659,2.435 12.462,2.238 8.98,0.268 8.652,0.202 8.126,0.859z" height="15.494" canvas.left="462.933" strokestartlinecap="round" strokeendlinecap="round" stroke="black" strokethickness="0.368" strokelinejoin="round" canvas.top="218.677" width="13.714"/> </canvas>
and canvas pieces project have on 10000 lines of xaml code. cause project overload - , application becomes impossible control. windowsform slowing/glowing on resize , drag.
recommend please better method draw lines project. final product must able react on mouseenter - actions on specific pieces project, info element , mouseleftbuttondown - add element list.
thx helps.
Comments
Post a Comment