如何在WPF中切割矩形或边框的直线边界而不是圆角

时间:2018-11-23 20:36:32

标签: wpf wpf-controls

任何人都可以在下面提供帮助,如何在WPF中实现下面的样式,如下面的屏幕截图所示

enter image description here

1 个答案:

答案 0 :(得分:0)

将此资源应用于矩形

<Window.Resources>
    <Grid x:Key="MyPath" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
        <Path Data="M78.5,39.093C78.5,39.247 78.422,39.305 78.308,39.234 78.176,39.153 78.161,39.189 78.26,39.349 78.34,39.478 78.382,40.84 78.355,42.375L78.305,45.167 78.694,45.312C78.908,45.391 79.177,45.421 79.292,45.377 79.406,45.333 79.5,45.387 79.5,45.497 79.5,45.607 79.647,45.821 79.828,45.973 80.207,46.293 80.346,47.152 80.406,49.534 80.451,51.29 80.566,51.565 81.417,51.936 81.692,52.056 81.804,52.159 81.667,52.165 81.477,52.174 81.498,52.238 81.75,52.429 81.933,52.568 82.089,52.734 82.097,52.799 82.104,52.864 82.158,53.104 82.216,53.333 82.407,54.089 82.538,55.395 82.575,56.898 82.605,58.139 82.663,58.419 82.93,58.619 83.106,58.75 83.227,58.939 83.199,59.04 83.171,59.141 83.279,59.117 83.439,58.987 83.625,58.835 83.685,58.825 83.605,58.958 83.537,59.073 83.56,59.167 83.657,59.167 83.754,59.167 83.833,59.282 83.833,59.422 83.833,59.562 83.944,59.72 84.079,59.771 84.421,59.903 84.709,62.641 84.668,65.376 84.664,65.628 84.719,65.824 84.789,65.81 85.062,65.757 85.995,66.207 85.907,66.35 85.855,66.432 85.926,66.5 86.062,66.5 86.492,66.5 86.673,67.526 86.73,70.305 86.776,72.528 86.831,72.659 87.718,72.664 87.99,72.666 88.143,72.737 88.083,72.835 88.026,72.927 88.094,73.047 88.235,73.101 88.572,73.23 88.66,73.816 88.732,76.41 88.772,77.83 88.858,78.591 88.983,78.633 89.087,78.668 89.266,78.79 89.379,78.903 89.493,79.017 89.69,79.076 89.816,79.033 89.943,78.991 90,79.032 89.943,79.124 89.886,79.216 90.014,79.423 90.228,79.583 90.478,79.771 90.601,80.016 90.573,80.271 90.549,80.488 90.58,80.667 90.642,80.667 90.704,80.667 90.768,80.985 90.783,81.375 90.91,84.504 91.098,85.333 91.682,85.333 91.877,85.333 91.957,85.419 91.9,85.566 91.851,85.695 91.902,85.856 92.014,85.926 92.153,86.011 92.179,85.977 92.097,85.817 92.03,85.689 92.082,85.713 92.212,85.872 92.343,86.031 92.51,86.106 92.585,86.039 92.659,85.972 92.671,86.002 92.612,86.106 92.552,86.21 92.617,86.39 92.756,86.505 93.038,86.739 92.949,87.223 92.526,87.75 92.367,87.948 92.355,87.999 92.496,87.875 92.816,87.594 93.089,87.609 92.852,87.895 92.341,88.509 90.656,88.499 194.85,88.542L296.583,88.584 194.655,88.584C113.112,88.583 92.768,88.625 92.935,88.792 93.17,89.027 296.654,89.11 296.681,88.875 296.688,88.806 296.713,88.585 296.735,88.383 296.758,88.181 296.719,88.051 296.649,88.094 296.579,88.138 296.585,87.952 296.662,87.682 296.74,87.413 296.763,87.152 296.715,87.104 296.562,86.951 296.835,86.148 297.005,86.253 297.094,86.308 297.167,86.263 297.167,86.153 297.167,86.043 297.298,85.846 297.458,85.714 297.619,85.583 297.645,85.53 297.516,85.597 297.369,85.673 297.323,85.651 297.393,85.539 297.454,85.44 297.726,85.31 297.997,85.251 298.508,85.138 298.833,84.34 298.607,83.751 298.554,83.613 298.564,83.5 298.63,83.5 298.696,83.5 298.758,83.219 298.769,82.875 298.802,81.765 298.945,80.557 299.067,80.359 299.133,80.253 299.141,80.094 299.086,80.005 299.031,79.916 299.174,79.68 299.404,79.48 299.634,79.28 299.775,79.034 299.718,78.933 299.66,78.832 299.672,78.803 299.744,78.868 299.956,79.06 300.813,78.529 300.809,78.209 300.8,77.562 301.017,73.847 301.084,73.497 301.152,73.141 301.723,72.612 302.083,72.57 302.175,72.56 302.338,72.539 302.445,72.525 302.773,72.483 302.958,71.491 302.918,70 302.869,68.193 303.082,67.143 303.701,66.136 304.194,65.335 304.409,65.11 304.227,65.583 303.996,66.184 304.359,65.76 304.69,65.042 304.982,64.408 305.062,63.891 305.094,62.451 305.133,60.712 305.424,59.167 305.713,59.167 305.79,59.167 305.814,59.103 305.766,59.025 305.637,58.818 306.392,58.215 306.72,58.263 307.041,58.31 307.032,58.363 307.115,55.917 307.191,53.673 307.208,53.5 307.354,53.5 307.418,53.5 307.449,53.369 307.422,53.208 307.396,53.048 307.549,52.682 307.763,52.396 307.977,52.109 308.111,51.833 308.06,51.782 308.009,51.731 308.136,51.733 308.343,51.788 308.627,51.862 308.685,51.832 308.582,51.665 308.484,51.505 308.52,51.472 308.714,51.547 309.026,51.666 309.19,51.292 309.146,50.563 309.13,50.299 309.175,49.558 309.245,48.917 309.355,47.911 309.416,47.269 309.484,46.383 309.512,46.021 310.34,45.333 310.746,45.333 311.31,45.333 311.366,45.014 311.315,42.112 311.291,40.714 311.334,39.468 311.411,39.343 311.506,39.189 311.489,39.154 311.359,39.234 311.245,39.305 311.167,39.247 311.167,39.093 311.167,38.858 300.087,38.833 194.833,38.833 89.58,38.833 78.5,38.858 78.5,39.093" Fill="#FFFCCC53" />
        <Path Data="M77.937,39.134C77.892,39.207 77.845,40.501 77.833,42.009 77.802,45.951 77.794,45.833 78.105,45.833 78.537,45.833 79.5,46.962 79.501,47.47 79.501,47.716 79.571,48.179 79.656,48.5 79.741,48.821 79.846,49.683 79.889,50.417 79.97,51.799 80.245,52.833 80.531,52.833 80.769,52.833 81.321,53.536 81.328,53.847 81.331,53.992 81.385,54.163 81.448,54.225 81.768,54.546 81.949,55.66 81.98,57.506 82.016,59.687 82.062,59.909 82.443,59.763 82.72,59.657 83.449,60.37 83.708,61 83.803,61.229 83.893,62.471 83.91,63.759 83.94,66.139 84.007,66.5 84.416,66.5 85.389,66.5 86.055,68.054 86.089,70.401 86.119,72.505 86.215,72.94 86.68,73.088 87.71,73.414 88.119,74.558 88.214,77.377 88.267,78.96 88.317,79.21 88.637,79.508 88.837,79.694 89,79.787 89.001,79.715 89.001,79.643 89.226,79.921 89.5,80.333 89.774,80.746 89.999,81.247 89.999,81.447 90,81.648 90.068,81.992 90.152,82.211 90.236,82.431 90.358,83.464 90.425,84.507 90.504,85.744 90.624,86.482 90.773,86.63 90.898,86.755 91,86.799 91,86.729 91,86.658 91.077,86.677 91.171,86.771 91.416,87.016 91.513,87.667 91.303,87.667 91.198,87.667 91.219,87.781 91.355,87.949 91.48,88.104 91.502,88.182 91.403,88.123 91.303,88.063 91.222,88.127 91.222,88.265 91.222,88.402 91.317,88.478 91.434,88.433 91.55,88.389 91.669,88.424 91.698,88.511 91.732,88.612 129.504,88.669 194.532,88.668 260.276,88.667 297.349,88.725 297.413,88.827 297.53,89.016 298.1,88.513 298.106,88.216 298.109,88.105 298.049,88.053 297.972,88.101 297.896,88.148 297.833,88.107 297.833,88.01 297.833,87.913 297.903,87.833 297.988,87.833 298.08,87.833 298.087,87.636 298.005,87.35 297.86,86.846 298.042,86.5 298.45,86.5 298.569,86.5 298.667,86.383 298.667,86.24 298.667,86.097 298.739,86.025 298.828,86.08 299.033,86.207 299.122,85.774 299.254,84 299.446,81.431 299.75,80.542 300.762,79.583 301.378,79.001 301.48,78.601 301.511,76.669 301.544,74.571 301.91,73.434 302.613,73.238 303.351,73.032 303.464,72.697 303.538,70.5 303.616,68.166 303.614,68.181 304.106,67.259 304.356,66.791 304.614,66.553 304.973,66.46 305.688,66.275 305.694,66.252 305.732,63.615 305.772,60.905 306.028,60.14 307.088,59.569L307.667,59.258 307.688,57.295C307.71,55.149 307.696,55.28 307.972,54.614 308.079,54.356 308.167,54.032 308.167,53.895 308.167,53.507 308.507,52.958 309.034,52.496 309.551,52.043 309.692,51.42 309.92,48.583 310.034,47.164 310.528,46.119 311.186,45.911 311.359,45.856 311.5,45.736 311.5,45.646 311.5,45.555 311.572,45.525 311.659,45.579 311.857,45.701 311.972,40.207 311.787,39.497 311.667,39.037 311.167,38.778 311.167,39.177 311.167,39.274 311.253,39.299 311.359,39.234 311.489,39.154 311.506,39.189 311.411,39.343 311.334,39.468 311.291,40.714 311.315,42.112 311.366,45.014 311.31,45.333 310.746,45.333 310.34,45.333 309.512,46.021 309.484,46.383 309.416,47.269 309.355,47.911 309.245,48.917 309.175,49.558 309.13,50.299 309.146,50.563 309.19,51.292 309.026,51.666 308.714,51.547 308.52,51.472 308.484,51.505 308.582,51.665 308.685,51.832 308.627,51.862 308.343,51.788 308.136,51.733 308.009,51.731 308.06,51.782 308.111,51.833 307.977,52.109 307.763,52.396 307.549,52.682 307.396,53.048 307.422,53.208 307.449,53.369 307.418,53.5 307.354,53.5 307.208,53.5 307.191,53.673 307.115,55.917 307.032,58.363 307.041,58.31 306.72,58.263 306.392,58.215 305.637,58.818 305.766,59.025 305.814,59.103 305.79,59.167 305.713,59.167 305.424,59.167 305.133,60.712 305.094,62.451 305.062,63.891 304.982,64.408 304.69,65.042 304.359,65.76 303.996,66.184 304.227,65.583 304.409,65.11 304.194,65.335 303.701,66.136 303.082,67.143 302.869,68.193 302.918,70 302.958,71.491 302.773,72.483 302.445,72.525 302.338,72.539 302.175,72.56 302.083,72.57 301.723,72.612 301.152,73.141 301.084,73.497 301.017,73.847 300.8,77.562 300.809,78.209 300.813,78.529 299.956,79.06 299.744,78.868 299.672,78.803 299.66,78.832 299.718,78.933 299.775,79.034 299.634,79.28 299.404,79.48 299.174,79.68 299.031,79.916 299.086,80.005 299.141,80.094 299.133,80.253 299.067,80.359 298.945,80.557 298.802,81.765 298.769,82.875 298.758,83.219 298.696,83.5 298.63,83.5 298.564,83.5 298.554,83.613 298.607,83.751 298.833,84.34 298.508,85.138 297.997,85.251 297.726,85.31 297.454,85.44 297.393,85.539 297.323,85.651 297.369,85.673 297.516,85.597 297.645,85.53 297.619,85.583 297.458,85.714 297.298,85.846 297.167,86.043 297.167,86.153 297.167,86.263 297.094,86.308 297.005,86.253 296.835,86.148 296.562,86.951 296.715,87.104 296.763,87.152 296.74,87.413 296.662,87.682 296.585,87.952 296.576,88.14 296.642,88.099 296.708,88.058 296.762,88.15 296.762,88.304 296.762,88.656 93.314,88.663 92.89,88.311 92.718,88.168 92.709,88.067 92.852,87.895 93.089,87.609 92.816,87.594 92.496,87.875 92.355,87.999 92.367,87.948 92.526,87.75 92.949,87.223 93.038,86.739 92.756,86.505 92.617,86.39 92.552,86.21 92.612,86.106 92.671,86.002 92.659,85.972 92.585,86.039 92.51,86.106 92.343,86.031 92.212,85.872 92.082,85.713 92.03,85.689 92.097,85.817 92.179,85.977 92.153,86.011 92.014,85.926 91.902,85.856 91.851,85.695 91.9,85.566 91.957,85.419 91.877,85.333 91.682,85.333 91.098,85.333 90.91,84.504 90.783,81.375 90.768,80.985 90.704,80.667 90.642,80.667 90.58,80.667 90.549,80.488 90.573,80.271 90.601,80.016 90.478,79.771 90.228,79.583 90.014,79.423 89.886,79.216 89.943,79.124 90,79.032 89.943,78.991 89.816,79.033 89.69,79.076 89.493,79.017 89.379,78.903 89.266,78.79 89.087,78.668 88.983,78.633 88.858,78.591 88.772,77.83 88.732,76.41 88.66,73.816 88.572,73.23 88.235,73.101 88.094,73.047 88.026,72.927 88.083,72.835 88.143,72.737 87.99,72.666 87.718,72.664 86.831,72.659 86.776,72.528 86.73,70.305 86.673,67.526 86.492,66.5 86.062,66.5 85.926,66.5 85.855,66.432 85.907,66.35 85.995,66.207 85.062,65.757 84.789,65.81 84.719,65.824 84.664,65.628 84.668,65.376 84.709,62.641 84.421,59.903 84.079,59.771 83.944,59.72 83.833,59.562 83.833,59.422 83.833,59.282 83.754,59.167 83.657,59.167 83.56,59.167 83.537,59.073 83.605,58.958 83.685,58.825 83.625,58.835 83.439,58.987 83.279,59.117 83.171,59.141 83.199,59.04 83.227,58.939 83.106,58.75 82.93,58.619 82.663,58.419 82.605,58.139 82.575,56.898 82.538,55.395 82.407,54.089 82.216,53.333 82.158,53.104 82.104,52.864 82.097,52.799 82.089,52.734 81.933,52.568 81.75,52.429 81.498,52.238 81.477,52.174 81.667,52.165 81.804,52.159 81.692,52.056 81.417,51.936 80.566,51.565 80.451,51.29 80.406,49.534 80.346,47.152 80.207,46.293 79.828,45.973 79.647,45.821 79.5,45.607 79.5,45.497 79.5,45.387 79.406,45.333 79.292,45.377 79.177,45.421 78.908,45.391 78.694,45.312L78.305,45.167 78.355,42.375C78.382,40.84 78.34,39.478 78.26,39.349 78.161,39.189 78.176,39.153 78.308,39.234 78.413,39.299 78.5,39.274 78.5,39.177 78.5,38.971 78.058,38.937 77.937,39.134" Fill="#FFF0D04C" />
        <Path Data="M77.937,39.134C77.892,39.207 77.845,40.501 77.833,42.009 77.802,45.951 77.794,45.833 78.105,45.833 78.537,45.833 79.5,46.962 79.501,47.47 79.501,47.716 79.571,48.179 79.656,48.5 79.741,48.821 79.846,49.683 79.889,50.417 79.97,51.799 80.245,52.833 80.531,52.833 80.769,52.833 81.321,53.536 81.328,53.847 81.331,53.992 81.385,54.163 81.448,54.225 81.768,54.546 81.949,55.66 81.98,57.506 82.016,59.687 82.062,59.909 82.443,59.763 82.72,59.657 83.449,60.37 83.708,61 83.803,61.229 83.893,62.471 83.91,63.759 83.94,66.139 84.007,66.5 84.416,66.5 85.389,66.5 86.055,68.054 86.089,70.401 86.119,72.505 86.215,72.94 86.68,73.088 87.71,73.414 88.119,74.558 88.214,77.377 88.267,78.96 88.317,79.21 88.637,79.508 88.837,79.694 89,79.787 89.001,79.715 89.001,79.643 89.226,79.921 89.5,80.333 89.774,80.746 89.999,81.247 89.999,81.447 90,81.648 90.068,81.992 90.152,82.211 90.236,82.431 90.358,83.464 90.425,84.507 90.504,85.744 90.624,86.482 90.773,86.63 90.898,86.755 91,86.799 91,86.729 91,86.658 91.077,86.677 91.171,86.771 91.416,87.016 91.513,87.667 91.303,87.667 91.198,87.667 91.219,87.781 91.355,87.949 91.48,88.104 91.502,88.182 91.403,88.123 91.303,88.063 91.222,88.127 91.222,88.265 91.222,88.402 91.317,88.478 91.434,88.433 91.55,88.389 91.669,88.424 91.698,88.511 91.732,88.612 129.504,88.669 194.532,88.668 260.276,88.667 297.349,88.725 297.413,88.827 297.53,89.016 298.1,88.513 298.106,88.216 298.109,88.105 298.049,88.053 297.972,88.101 297.896,88.148 297.833,88.107 297.833,88.01 297.833,87.913 297.903,87.833 297.988,87.833 298.08,87.833 298.087,87.636 298.005,87.35 297.86,86.846 298.042,86.5 298.45,86.5 298.569,86.5 298.667,86.383 298.667,86.24 298.667,86.097 298.739,86.025 298.828,86.08 299.033,86.207 299.122,85.774 299.254,84 299.446,81.431 299.75,80.542 300.762,79.583 301.378,79.001 301.48,78.601 301.511,76.669 301.544,74.571 301.91,73.434 302.613,73.238 303.351,73.032 303.464,72.697 303.538,70.5 303.616,68.166 303.614,68.181 304.106,67.259 304.356,66.791 304.614,66.553 304.973,66.46 305.688,66.275 305.694,66.252 305.732,63.615 305.772,60.905 306.028,60.14 307.088,59.569L307.667,59.258 307.688,57.295C307.71,55.149 307.696,55.28 307.972,54.614 308.079,54.356 308.167,54.032 308.167,53.895 308.167,53.507 308.507,52.958 309.034,52.496 309.551,52.043 309.692,51.42 309.92,48.583 310.034,47.164 310.528,46.119 311.186,45.911 311.359,45.856 311.5,45.736 311.5,45.646 311.5,45.555 311.572,45.525 311.659,45.579 311.857,45.701 311.972,40.207 311.787,39.497 311.667,39.037 311.167,38.778 311.167,39.177 311.167,39.274 311.253,39.299 311.359,39.234 311.489,39.154 311.506,39.189 311.411,39.343 311.334,39.468 311.291,40.714 311.315,42.112 311.366,45.014 311.31,45.333 310.746,45.333 310.34,45.333 309.512,46.021 309.484,46.383 309.416,47.269 309.355,47.911 309.245,48.917 309.175,49.558 309.13,50.299 309.146,50.563 309.19,51.292 309.026,51.666 308.714,51.547 308.52,51.472 308.484,51.505 308.582,51.665 308.685,51.832 308.627,51.862 308.343,51.788 308.136,51.733 308.009,51.731 308.06,51.782 308.111,51.833 307.977,52.109 307.763,52.396 307.549,52.682 307.396,53.048 307.422,53.208 307.449,53.369 307.418,53.5 307.354,53.5 307.208,53.5 307.191,53.673 307.115,55.917 307.032,58.363 307.041,58.31 306.72,58.263 306.392,58.215 305.637,58.818 305.766,59.025 305.814,59.103 305.79,59.167 305.713,59.167 305.424,59.167 305.133,60.712 305.094,62.451 305.062,63.891 304.982,64.408 304.69,65.042 304.359,65.76 303.996,66.184 304.227,65.583 304.409,65.11 304.194,65.335 303.701,66.136 303.082,67.143 302.869,68.193 302.918,70 302.958,71.491 302.773,72.483 302.445,72.525 302.338,72.539 302.175,72.56 302.083,72.57 301.723,72.612 301.152,73.141 301.084,73.497 301.017,73.847 300.8,77.562 300.809,78.209 300.813,78.529 299.956,79.06 299.744,78.868 299.672,78.803 299.66,78.832 299.718,78.933 299.775,79.034 299.634,79.28 299.404,79.48 299.174,79.68 299.031,79.916 299.086,80.005 299.141,80.094 299.133,80.253 299.067,80.359 298.945,80.557 298.802,81.765 298.769,82.875 298.758,83.219 298.696,83.5 298.63,83.5 298.564,83.5 298.554,83.613 298.607,83.751 298.833,84.34 298.508,85.138 297.997,85.251 297.726,85.31 297.454,85.44 297.393,85.539 297.323,85.651 297.369,85.673 297.516,85.597 297.645,85.53 297.619,85.583 297.458,85.714 297.298,85.846 297.167,86.043 297.167,86.153 297.167,86.263 297.094,86.308 297.005,86.253 296.835,86.148 296.562,86.951 296.715,87.104 296.763,87.152 296.74,87.413 296.662,87.682 296.585,87.952 296.576,88.14 296.642,88.099 296.708,88.058 296.762,88.15 296.762,88.304 296.762,88.656 93.314,88.663 92.89,88.311 92.718,88.168 92.709,88.067 92.852,87.895 93.089,87.609 92.816,87.594 92.496,87.875 92.355,87.999 92.367,87.948 92.526,87.75 92.949,87.223 93.038,86.739 92.756,86.505 92.617,86.39 92.552,86.21 92.612,86.106 92.671,86.002 92.659,85.972 92.585,86.039 92.51,86.106 92.343,86.031 92.212,85.872 92.082,85.713 92.03,85.689 92.097,85.817 92.179,85.977 92.153,86.011 92.014,85.926 91.902,85.856 91.851,85.695 91.9,85.566 91.957,85.419 91.877,85.333 91.682,85.333 91.098,85.333 90.91,84.504 90.783,81.375 90.768,80.985 90.704,80.667 90.642,80.667 90.58,80.667 90.549,80.488 90.573,80.271 90.601,80.016 90.478,79.771 90.228,79.583 90.014,79.423 89.886,79.216 89.943,79.124 90,79.032 89.943,78.991 89.816,79.033 89.69,79.076 89.493,79.017 89.379,78.903 89.266,78.79 89.087,78.668 88.983,78.633 88.858,78.591 88.772,77.83 88.732,76.41 88.66,73.816 88.572,73.23 88.235,73.101 88.094,73.047 88.026,72.927 88.083,72.835 88.143,72.737 87.99,72.666 87.718,72.664 86.831,72.659 86.776,72.528 86.73,70.305 86.673,67.526 86.492,66.5 86.062,66.5 85.926,66.5 85.855,66.432 85.907,66.35 85.995,66.207 85.062,65.757 84.789,65.81 84.719,65.824 84.664,65.628 84.668,65.376 84.709,62.641 84.421,59.903 84.079,59.771 83.944,59.72 83.833,59.562 83.833,59.422 83.833,59.282 83.754,59.167 83.657,59.167 83.56,59.167 83.537,59.073 83.605,58.958 83.685,58.825 83.625,58.835 83.439,58.987 83.279,59.117 83.171,59.141 83.199,59.04 83.227,58.939 83.106,58.75 82.93,58.619 82.663,58.419 82.605,58.139 82.575,56.898 82.538,55.395 82.407,54.089 82.216,53.333 82.158,53.104 82.104,52.864 82.097,52.799 82.089,52.734 81.933,52.568 81.75,52.429 81.498,52.238 81.477,52.174 81.667,52.165 81.804,52.159 81.692,52.056 81.417,51.936 80.566,51.565 80.451,51.29 80.406,49.534 80.346,47.152 80.207,46.293 79.828,45.973 79.647,45.821 79.5,45.607 79.5,45.497 79.5,45.387 79.406,45.333 79.292,45.377 79.177,45.421 78.908,45.391 78.694,45.312L78.305,45.167 78.355,42.375C78.382,40.84 78.34,39.478 78.26,39.349 78.161,39.189 78.176,39.153 78.308,39.234 78.413,39.299 78.5,39.274 78.5,39.177 78.5,38.971 78.058,38.937 77.937,39.134" Fill="#FFF0D04C" />
        <Path Data="M77.937,39.134C77.892,39.207 77.845,40.501 77.833,42.009 77.802,45.951 77.794,45.833 78.105,45.833 78.537,45.833 79.5,46.962 79.501,47.47 79.501,47.716 79.571,48.179 79.656,48.5 79.741,48.821 79.846,49.683 79.889,50.417 79.97,51.799 80.245,52.833 80.531,52.833 80.769,52.833 81.321,53.536 81.328,53.847 81.331,53.992 81.385,54.163 81.448,54.225 81.768,54.546 81.949,55.66 81.98,57.506 82.016,59.687 82.062,59.909 82.443,59.763 82.72,59.657 83.449,60.37 83.708,61 83.803,61.229 83.893,62.471 83.91,63.759 83.94,66.139 84.007,66.5 84.416,66.5 85.389,66.5 86.055,68.054 86.089,70.401 86.119,72.505 86.215,72.94 86.68,73.088 87.71,73.414 88.119,74.558 88.214,77.377 88.267,78.96 88.317,79.21 88.637,79.508 88.837,79.694 89,79.787 89.001,79.715 89.001,79.643 89.226,79.921 89.5,80.333 89.774,80.746 89.999,81.247 89.999,81.447 90,81.648 90.068,81.992 90.152,82.211 90.236,82.431 90.358,83.464 90.425,84.507 90.504,85.744 90.624,86.482 90.773,86.63 90.898,86.755 91,86.799 91,86.729 91,86.658 91.077,86.677 91.171,86.771 91.416,87.016 91.513,87.667 91.303,87.667 91.198,87.667 91.219,87.781 91.355,87.949 91.48,88.104 91.502,88.182 91.403,88.123 91.303,88.063 91.222,88.127 91.222,88.265 91.222,88.402 91.317,88.478 91.434,88.433 91.55,88.389 91.669,88.424 91.698,88.511 91.732,88.612 129.504,88.669 194.532,88.668 260.276,88.667 297.349,88.725 297.413,88.827 297.53,89.016 298.1,88.513 298.106,88.216 298.109,88.105 298.049,88.053 297.972,88.101 297.896,88.148 297.833,88.107 297.833,88.01 297.833,87.913 297.903,87.833 297.988,87.833 298.08,87.833 298.087,87.636 298.005,87.35 297.86,86.846 298.042,86.5 298.45,86.5 298.569,86.5 298.667,86.383 298.667,86.24 298.667,86.097 298.739,86.025 298.828,86.08 299.033,86.207 299.122,85.774 299.254,84 299.446,81.431 299.75,80.542 300.762,79.583 301.378,79.001 301.48,78.601 301.511,76.669 301.544,74.571 301.91,73.434 302.613,73.238 303.351,73.032 303.464,72.697 303.538,70.5 303.616,68.166 303.614,68.181 304.106,67.259 304.356,66.791 304.614,66.553 304.973,66.46 305.688,66.275 305.694,66.252 305.732,63.615 305.772,60.905 306.028,60.14 307.088,59.569L307.667,59.258 307.688,57.295C307.71,55.149 307.696,55.28 307.972,54.614 308.079,54.356 308.167,54.032 308.167,53.895 308.167,53.507 308.507,52.958 309.034,52.496 309.551,52.043 309.692,51.42 309.92,48.583 310.034,47.164 310.528,46.119 311.186,45.911 311.359,45.856 311.5,45.736 311.5,45.646 311.5,45.555 311.572,45.525 311.659,45.579 311.857,45.701 311.972,40.207 311.787,39.497 311.667,39.037 311.167,38.778 311.167,39.177 311.167,39.274 311.253,39.299 311.359,39.234 311.489,39.154 311.506,39.189 311.411,39.343 311.334,39.468 311.291,40.714 311.315,42.112 311.366,45.014 311.31,45.333 310.746,45.333 310.34,45.333 309.512,46.021 309.484,46.383 309.416,47.269 309.355,47.911 309.245,48.917 309.175,49.558 309.13,50.299 309.146,50.563 309.19,51.292 309.026,51.666 308.714,51.547 308.52,51.472 308.484,51.505 308.582,51.665 308.685,51.832 308.627,51.862 308.343,51.788 308.136,51.733 308.009,51.731 308.06,51.782 308.111,51.833 307.977,52.109 307.763,52.396 307.549,52.682 307.396,53.048 307.422,53.208 307.449,53.369 307.418,53.5 307.354,53.5 307.208,53.5 307.191,53.673 307.115,55.917 307.032,58.363 307.041,58.31 306.72,58.263 306.392,58.215 305.637,58.818 305.766,59.025 305.814,59.103 305.79,59.167 305.713,59.167 305.424,59.167 305.133,60.712 305.094,62.451 305.062,63.891 304.982,64.408 304.69,65.042 304.359,65.76 303.996,66.184 304.227,65.583 304.409,65.11 304.194,65.335 303.701,66.136 303.082,67.143 302.869,68.193 302.918,70 302.958,71.491 302.773,72.483 302.445,72.525 302.338,72.539 302.175,72.56 302.083,72.57 301.723,72.612 301.152,73.141 301.084,73.497 301.017,73.847 300.8,77.562 300.809,78.209 300.813,78.529 299.956,79.06 299.744,78.868 299.672,78.803 299.66,78.832 299.718,78.933 299.775,79.034 299.634,79.28 299.404,79.48 299.174,79.68 299.031,79.916 299.086,80.005 299.141,80.094 299.133,80.253 299.067,80.359 298.945,80.557 298.802,81.765 298.769,82.875 298.758,83.219 298.696,83.5 298.63,83.5 298.564,83.5 298.554,83.613 298.607,83.751 298.833,84.34 298.508,85.138 297.997,85.251 297.726,85.31 297.454,85.44 297.393,85.539 297.323,85.651 297.369,85.673 297.516,85.597 297.645,85.53 297.619,85.583 297.458,85.714 297.298,85.846 297.167,86.043 297.167,86.153 297.167,86.263 297.094,86.308 297.005,86.253 296.835,86.148 296.562,86.951 296.715,87.104 296.763,87.152 296.74,87.413 296.662,87.682 296.585,87.952 296.576,88.14 296.642,88.099 296.708,88.058 296.762,88.15 296.762,88.304 296.762,88.656 93.314,88.663 92.89,88.311 92.718,88.168 92.709,88.067 92.852,87.895 93.089,87.609 92.816,87.594 92.496,87.875 92.355,87.999 92.367,87.948 92.526,87.75 92.949,87.223 93.038,86.739 92.756,86.505 92.617,86.39 92.552,86.21 92.612,86.106 92.671,86.002 92.659,85.972 92.585,86.039 92.51,86.106 92.343,86.031 92.212,85.872 92.082,85.713 92.03,85.689 92.097,85.817 92.179,85.977 92.153,86.011 92.014,85.926 91.902,85.856 91.851,85.695 91.9,85.566 91.957,85.419 91.877,85.333 91.682,85.333 91.098,85.333 90.91,84.504 90.783,81.375 90.768,80.985 90.704,80.667 90.642,80.667 90.58,80.667 90.549,80.488 90.573,80.271 90.601,80.016 90.478,79.771 90.228,79.583 90.014,79.423 89.886,79.216 89.943,79.124 90,79.032 89.943,78.991 89.816,79.033 89.69,79.076 89.493,79.017 89.379,78.903 89.266,78.79 89.087,78.668 88.983,78.633 88.858,78.591 88.772,77.83 88.732,76.41 88.66,73.816 88.572,73.23 88.235,73.101 88.094,73.047 88.026,72.927 88.083,72.835 88.143,72.737 87.99,72.666 87.718,72.664 86.831,72.659 86.776,72.528 86.73,70.305 86.673,67.526 86.492,66.5 86.062,66.5 85.926,66.5 85.855,66.432 85.907,66.35 85.995,66.207 85.062,65.757 84.789,65.81 84.719,65.824 84.664,65.628 84.668,65.376 84.709,62.641 84.421,59.903 84.079,59.771 83.944,59.72 83.833,59.562 83.833,59.422 83.833,59.282 83.754,59.167 83.657,59.167 83.56,59.167 83.537,59.073 83.605,58.958 83.685,58.825 83.625,58.835 83.439,58.987 83.279,59.117 83.171,59.141 83.199,59.04 83.227,58.939 83.106,58.75 82.93,58.619 82.663,58.419 82.605,58.139 82.575,56.898 82.538,55.395 82.407,54.089 82.216,53.333 82.158,53.104 82.104,52.864 82.097,52.799 82.089,52.734 81.933,52.568 81.75,52.429 81.498,52.238 81.477,52.174 81.667,52.165 81.804,52.159 81.692,52.056 81.417,51.936 80.566,51.565 80.451,51.29 80.406,49.534 80.346,47.152 80.207,46.293 79.828,45.973 79.647,45.821 79.5,45.607 79.5,45.497 79.5,45.387 79.406,45.333 79.292,45.377 79.177,45.421 78.908,45.391 78.694,45.312L78.305,45.167 78.355,42.375C78.382,40.84 78.34,39.478 78.26,39.349 78.161,39.189 78.176,39.153 78.308,39.234 78.413,39.299 78.5,39.274 78.5,39.177 78.5,38.971 78.058,38.937 77.937,39.134" Fill="#FFF0D04C" />
    </Grid>
</Window.Resources>

您的矩形

<Rectangle Width="150" Height="20" Fill="#FFFACB51">
    <Rectangle.OpacityMask>
        <VisualBrush Stretch="Fill" Visual="{StaticResource MyPath}" />
    </Rectangle.OpacityMask>
</Rectangle>

输出

Output

注意*保持高宽比以保持此形状。