我有一个svg图像,我转换为xaml画布文件。
但是当我将这个画布添加到我的窗口时,它太大了。我希望带有staticresource LynxLogo的contentpresenter适合父画布。
主窗口的Xaml:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Digicom.DESDigitelClientWPF"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="Digicom.DESDigitelClientWPF.FindServer2"
Title="MainWindow" Height="489" Width="715"
>
<Grid>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#FFA9C825"/>
<GradientStop Color="#FF698700" Offset="1"/>
<GradientStop Color="#FFA9C825" Offset="0.539"/>
</LinearGradientBrush>
</Grid.Background>
<DataGrid ItemsSource="{Binding Servers, Mode=TwoWay}" SelectedItem="{Binding SelectedServer, Mode=TwoWay}" AutoGenerateColumns="false" GridLinesVisibility="None" Margin="39.025,51.76,39.025,0" RowHeaderWidth="0" Foreground="Black" CanUserResizeRows="False" CanUserAddRows="False" Height="132" VerticalAlignment="Top" Background="#FFE2E2E2">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding HostName}" Header="Server" Width="200" IsReadOnly="True" SortMemberPath="Server"/>
<DataGridTextColumn Binding="{Binding Server}" Header="IP" Width="200" IsReadOnly="True" SortMemberPath="IP" />
<DataGridTextColumn Binding="{Binding Version}" Header="Version" Width="*" IsReadOnly="True" Foreground="#FF0C0B0B" />
</DataGrid.Columns>
</DataGrid>
<Canvas HorizontalAlignment="Left" Height="57" Margin="22,0,0,18" VerticalAlignment="Bottom" Width="112">
<ContentPresenter Content="{StaticResource LynxLogo}" Width="{Binding Width}" Height="{Binding Height}"/> **// THIS MUST FIT CANVAS**
</Canvas>
</Grid>
这是我从svg图像中获取的xaml画布并放入了我的应用程序资源
<Application.Resources>
<Canvas x:Key="LynxLogo" Width="673.152" Height="408.613" Clip="F1 M 0,0L 673.152,0L 673.152,408.613L 0,408.613L 0,0">
<Canvas x:Name="Laag_1" Width="799.785" Height="599.567" Canvas.Left="0" Canvas.Top="0">
<Path x:Name="Path" Width="20.38" Height="26.328" Canvas.Left="260.39" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 272.361,372.544L 268.799,372.544L 268.799,349.571L 260.785,349.571L 260.785,347.006L 280.375,347.006L 280.375,349.571L 272.361,349.571L 272.361,372.544 Z "/>
<Path x:Name="Path_0" Width="17.476" Height="26.3279" Canvas.Left="279.517" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 279.911,347.005L 296.598,347.005L 296.598,349.57L 283.473,349.57L 283.473,358.261L 295.243,358.261L 295.243,360.828L 283.473,360.828L 283.473,369.979L 296.598,369.979L 296.598,372.544L 279.911,372.544L 279.911,347.005 Z "/>
<Path x:Name="Path_1" Width="16.7787" Height="26.3279" Canvas.Left="301.277" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 301.671,347.005L 305.233,347.005L 305.233,369.979L 317.661,369.979L 317.661,372.544L 301.671,372.544L 301.671,347.005 Z "/>
<Path x:Name="Path_2" Width="17.476" Height="26.3279" Canvas.Left="319.629" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 320.024,347.005L 336.711,347.005L 336.711,349.57L 323.585,349.57L 323.585,358.261L 335.356,358.261L 335.356,360.828L 323.585,360.828L 323.585,369.979L 336.711,369.979L 336.711,372.544L 320.024,372.544L 320.024,347.005 Z "/>
<Viewbox x:Name="Group" Width="673.152" Height="408.613" Canvas.Left="0" Canvas.Top="0">
<Canvas Width="673.152" Height="408.613">
<Canvas Width="799.785" Height="599.567" x:Name="Clip" Clip="F1 M 0,0L 673.152,0L 673.152,408.613L 0,408.613L 0,0 Z ">
<Path x:Name="Path_3" Width="21.696" Height="27.1693" Canvas.Left="340.034" Canvas.Top="346.19" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 360.988,372.199C 358.974,372.621 356.768,372.965 354.29,372.965C 346.508,372.965 340.429,368.831 340.429,359.794C 340.429,351.869 345.733,346.585 354.29,346.585C 356.574,346.585 358.704,346.851 360.988,347.274L 361.297,350.222C 359.013,349.61 356.922,349.15 354.29,349.15C 347.902,349.15 343.99,353.246 343.99,359.794C 343.99,365.23 346.74,370.399 354.29,370.399C 356.922,370.399 359.245,369.941 361.336,369.251L 360.988,372.199 Z "/>
<Path x:Name="Path_4" Width="28.5107" Height="27.1693" Canvas.Left="364.312" Canvas.Top="346.19" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 368.268,359.794C 368.268,365.23 371.017,370.4 378.566,370.4C 386.116,370.4 388.865,365.23 388.865,359.794C 388.865,353.246 384.954,349.15 378.566,349.15C 372.178,349.15 368.268,353.246 368.268,359.794 Z M 392.428,359.794C 392.428,368.83 386.349,372.965 378.566,372.965C 370.785,372.965 364.706,368.83 364.706,359.794C 364.706,351.869 370.01,346.585 378.566,346.585C 387.122,346.585 392.428,351.869 392.428,359.794 Z "/>
<Path x:Name="Path_5" Width="27.2733" Height="26.328" Canvas.Left="396.757" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 400.056,372.544L 397.152,372.544L 397.152,347.006L 402.573,347.006L 410.393,368.6L 418.563,347.006L 423.636,347.006L 423.636,372.544L 420.344,372.544L 420.344,350.758L 420.267,350.758L 412.02,372.544L 408.496,372.544L 400.173,350.336L 400.056,350.336L 400.056,372.544 Z "/>
<Path x:Name="Path_6" Width="16.1213" Height="27.1707" Canvas.Left="439.194" Canvas.Top="346.19" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363" Data="F1 M 439.589,368.715C 441.602,369.634 443.963,370.4 446.171,370.4C 448.57,370.4 451.358,369.558 451.358,366.955C 451.358,361.823 439.938,359.143 439.938,352.404C 439.938,348.268 443.731,346.584 447.719,346.584C 449.539,346.584 451.358,346.852 453.139,347.159L 453.526,350.184C 451.783,349.571 450.042,349.15 448.223,349.15C 444.429,349.15 443.499,351.102 443.499,352.634C 443.499,357.612 454.921,360.368 454.921,366.878C 454.921,371.356 450.739,372.966 446.673,372.966C 444.39,372.966 442.182,372.467 439.975,371.894L 439.589,368.715 Z "/>
<Path x:Name="Path_7" Width="37.7253" Height="26.3279" Canvas.Left="455.689" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363" Data="F1 M 456.083,347.005L 459.683,347.005L 467.466,369.405L 472.499,357.421L 468.589,347.005L 472.306,347.005L 474.319,353.247L 474.395,353.247L 476.797,347.005L 480.475,347.005L 475.945,357.381L 480.321,369.405L 489.379,347.005L 493.019,347.005L 482.101,372.544L 478.19,372.544L 474.165,361.517L 469.325,372.544L 465.375,372.544L 456.083,347.005 Z "/>
<Rectangle x:Name="Rectangle" Width="4.35064" Height="26.328" Canvas.Left="495.143" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363"/>
<Path x:Name="Path_8" Width="20.38" Height="26.328" Canvas.Left="501.531" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363" Data="F1 M 513.501,372.544L 509.94,372.544L 509.94,349.571L 501.925,349.571L 501.925,347.006L 521.516,347.006L 521.516,349.571L 513.501,349.571L 513.501,372.544 Z "/>
<Path x:Name="Path_9" Width="21.696" Height="27.1693" Canvas.Left="522.709" Canvas.Top="346.19" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363" Data="F1 M 543.663,372.199C 541.648,372.621 539.441,372.965 536.964,372.965C 529.183,372.965 523.104,368.831 523.104,359.794C 523.104,351.869 528.408,346.585 536.964,346.585C 539.248,346.585 541.378,346.851 543.663,347.274L 543.971,350.222C 541.688,349.61 539.596,349.15 536.964,349.15C 530.576,349.15 526.665,353.246 526.665,359.794C 526.665,365.23 529.413,370.399 536.964,370.399C 539.596,370.399 541.919,369.941 544.011,369.251L 543.663,372.199 Z "/>
<Path x:Name="Path_10" Width="23.0906" Height="26.3279" Canvas.Left="548.341" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363" Data="F1 M 552.298,347.005L 552.298,357.841L 567.475,357.841L 567.475,347.005L 571.037,347.005L 571.037,372.544L 567.475,372.544L 567.475,360.406L 552.298,360.406L 552.298,372.544L 548.735,372.544L 548.735,347.005L 552.298,347.005 Z "/>
<Rectangle x:Name="Rectangle_11" Width="4.35067" Height="26.328" Canvas.Left="576.607" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363"/>
<Path x:Name="Path_12" Width="23.8653" Height="26.3279" Canvas.Left="586.13" Canvas.Top="346.611" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363" Data="F1 M 586.525,347.005L 590.978,347.005L 606.232,368.6L 606.31,368.677L 606.31,347.005L 609.601,347.005L 609.601,372.544L 605.07,372.544L 589.893,351.217L 589.817,351.141L 589.817,372.544L 586.525,372.544L 586.525,347.005 Z "/>
<Path x:Name="Path_13" Width="25.2186" Height="27.1693" Canvas.Left="613.893" Canvas.Top="346.191" Stretch="Fill" StrokeThickness="0.789334" StrokeLineJoin="Round" Stroke="#FF646363" Fill="#FF646363" Data="F1 M 638.717,358.224L 638.717,371.74C 635.504,372.391 632.251,372.965 628.147,372.965C 620.365,372.965 614.288,368.831 614.288,359.795C 614.288,352.94 619.204,346.585 628.651,346.585C 631.941,346.585 634.691,346.968 637.324,347.58L 637.672,350.604C 635,349.761 632.251,349.149 629.464,349.149C 620.521,349.149 617.849,355.468 617.849,359.795C 617.849,365.231 620.597,370.4 628.147,370.4C 631.013,370.439 633.22,370.056 635.309,369.443L 635.309,360.597L 629.503,360.597L 629.503,358.224L 638.717,358.224 Z "/>
<Path x:Name="Path_14" Width="124.139" Height="207.715" Canvas.Left="123.058" Canvas.Top="117.516" Stretch="Fill" Fill="#FF646363" Data="F1 M 186.749,244.275L 186.749,320.136C 186.749,320.989 186.535,321.731 186.11,322.364C 185.686,323.005 184.951,323.509 183.894,323.873C 182.842,324.248 181.421,324.575 179.629,324.833C 177.833,325.092 175.673,325.231 173.145,325.231C 170.514,325.231 168.321,325.092 166.586,324.833C 164.845,324.575 163.421,324.248 162.311,323.873C 161.207,323.509 160.439,323.005 160.017,322.364C 159.598,321.731 159.389,320.989 159.389,320.136L 159.389,244.275L 125.311,170.393C 124.135,167.956 123.426,166.047 123.158,164.665C 122.891,163.303 123.158,162.228 123.954,161.491C 124.749,160.749 126.179,160.272 128.249,160.06C 130.314,159.851 133.095,159.744 136.595,159.744C 139.777,159.744 142.345,159.851 144.311,160.06C 146.274,160.272 147.833,160.563 148.999,160.928C 150.166,161.312 151.046,161.841 151.626,162.523C 152.205,163.212 152.765,164.091 153.301,165.147C 153.301,165.147 170.879,212.089 173.619,218.347L 173.933,218.347C 176.354,212.311 178.867,206.291 181.445,200.303C 184.026,194.315 186.642,188.4 189.289,182.565C 189.289,182.565 218.686,121.123 219.267,120.377C 219.851,119.64 220.642,119.084 221.658,118.709C 222.665,118.335 224.063,118.047 225.874,117.831C 227.675,117.623 229.947,117.516 232.707,117.516C 236.526,117.516 239.523,117.653 241.695,117.913C 243.861,118.179 245.377,118.685 246.229,119.424C 247.079,120.169 247.363,121.228 247.105,122.607C 246.835,123.981 246.123,125.844 244.957,128.172L 186.749,244.275 Z "/>
<Path x:Name="Path_15" Width="203.721" Height="211.712" Canvas.Left="436.522" Canvas.Top="116.029" Stretch="Fill" StrokeThickness="9.708" StrokeMiterLimit="2.75" Stroke="#FFA9C822" Data="F1 M 625.286,124.251C 627.466,122.434 629.201,121.347 630.486,120.997C 631.774,120.649 632.789,121.102 633.532,122.362C 634.274,123.621 634.769,125.689 635.017,128.555C 635.262,131.425 635.389,135.241 635.389,139.998C 635.389,144.478 635.314,147.975 635.165,150.495C 635.017,153.014 634.744,155.009 634.349,156.478C 633.954,157.947 633.482,159.07 632.937,159.837C 632.394,160.609 631.674,161.274 630.784,161.831L 554.277,222.297L 630.784,283.39C 631.674,284.093 632.418,284.861 633.012,285.701C 633.605,286.541 634.077,287.694 634.424,289.165C 634.769,290.634 635.017,292.629 635.165,295.147C 635.314,297.667 635.389,301.026 635.389,305.225C 635.389,309.843 635.262,313.486 635.017,316.142C 634.769,318.803 634.274,320.657 633.532,321.706C 632.789,322.755 631.774,323.107 630.486,322.755C 629.201,322.407 627.466,321.322 625.286,319.501L 536.897,245.39L 451.478,316.142C 449.301,317.822 447.541,318.907 446.204,319.397C 444.868,319.89 443.826,319.574 443.085,318.451C 442.341,317.334 441.872,315.375 441.673,312.573C 441.476,309.775 441.376,305.927 441.376,301.026C 441.376,296.827 441.45,293.399 441.598,290.738C 441.748,288.082 441.996,285.982 442.341,284.441C 442.69,282.902 443.184,281.783 443.826,281.081C 444.473,280.383 445.19,279.613 445.981,278.773L 517.881,220.406L 445.981,162.462C 445.19,161.763 444.473,161.063 443.826,160.362C 443.184,159.663 442.69,158.65 442.341,157.318C 441.996,155.989 441.748,154.135 441.598,151.754C 441.45,149.375 441.376,146.158 441.376,142.097C 441.376,137.759 441.501,134.223 441.748,131.494C 441.996,128.765 442.468,126.807 443.158,125.615C 443.853,124.429 444.868,123.973 446.204,124.251C 447.541,124.533 449.301,125.511 451.478,127.19L 536.302,197.733L 625.286,124.251 Z "/>
<Path x:Name="Path_16" Width="106.721" Height="206.761" Canvas.Left="34.7103" Canvas.Top="118.613" Stretch="Fill" Fill="#FF646363" Data="F1 M 141.432,313.447C 141.432,315.569 141.324,317.344 141.113,318.775C 140.9,320.205 140.557,321.425 140.08,322.432C 139.602,323.441 139.018,324.183 138.33,324.659C 137.64,325.137 136.82,325.375 135.865,325.375L 44.8903,325.375C 42.4489,325.375 40.1436,324.555 37.9716,322.911C 35.7969,321.267 34.7103,318.376 34.7103,314.243L 34.7103,123.704C 34.7103,122.856 34.9223,122.113 35.3476,121.477C 35.7689,120.84 36.5129,120.339 37.5729,119.967C 38.6316,119.596 40.0636,119.277 41.8676,119.012C 43.6703,118.748 45.8449,118.613 48.3889,118.613C 51.0383,118.613 53.2396,118.748 54.9889,119.012C 56.7383,119.277 58.1436,119.596 59.2036,119.967C 60.2636,120.339 61.0063,120.84 61.4316,121.477C 61.8529,122.113 62.0676,122.856 62.0676,123.704L 62.0676,301.677L 135.865,301.677C 136.82,301.677 137.64,301.916 138.33,302.393C 139.018,302.869 139.602,303.561 140.08,304.461C 140.557,305.363 140.9,306.555 141.113,308.039C 141.324,309.525 141.432,311.327 141.432,313.447 Z "/>
<Path x:Name="Path_17" Width="155.547" Height="207.239" Canvas.Left="260.853" Canvas.Top="119.348" Stretch="Fill" Fill="#FF646363" Data="F1 M 416.4,314.339C 416.4,316.461 416.042,318.263 415.332,319.748C 414.618,321.233 413.686,322.451 412.536,323.405C 411.384,324.36 410.094,325.049 408.67,325.473C 407.244,325.895 405.818,326.108 404.392,326.108L 395.348,326.108C 392.493,326.108 389.998,325.815 387.861,325.234C 385.722,324.652 383.694,323.591 381.774,322.053C 379.858,320.517 377.936,318.423 376.017,315.771C 374.1,313.121 372.061,309.727 369.91,305.591L 307.125,188.533C 303.842,182.489 300.536,176.154 297.2,169.526C 293.865,162.901 290.764,156.46 287.89,150.202L 287.573,150.202C 287.784,157.837 287.942,165.63 288.05,173.583C 288.154,181.534 288.209,189.435 288.209,197.281L 288.209,321.496C 288.209,322.24 287.985,322.954 287.538,323.644C 287.09,324.334 286.336,324.864 285.272,325.234C 284.208,325.607 282.812,325.922 281.077,326.189C 279.342,326.452 277.13,326.586 274.446,326.586C 271.76,326.586 269.55,326.452 267.816,326.189C 266.081,325.922 264.712,325.607 263.705,325.234C 262.697,324.864 261.972,324.334 261.524,323.644C 261.076,322.954 260.853,322.24 260.853,321.496L 260.853,131.595C 260.853,127.354 262.056,124.333 264.464,122.529C 266.872,120.728 269.498,119.825 272.344,119.825L 285.806,119.825C 288.977,119.825 291.63,120.09 293.765,120.62C 295.9,121.152 297.816,122.027 299.51,123.244C 301.205,124.465 302.849,126.163 304.437,128.335C 306.022,130.508 307.686,133.24 309.432,136.525L 357.697,226.864C 360.67,232.377 363.538,237.757 366.306,243.007C 369.072,248.255 371.736,253.424 374.298,258.515C 376.861,263.602 379.397,268.613 381.908,273.544C 384.418,278.474 386.902,283.432 389.364,288.414L 389.522,288.414C 389.309,280.04 389.176,271.316 389.124,262.252C 389.069,253.187 389.045,244.465 389.045,236.088L 389.045,124.437C 389.045,123.697 389.269,123.005 389.714,122.369C 390.162,121.733 390.916,121.177 391.981,120.7C 393.042,120.223 394.441,119.88 396.176,119.667C 397.91,119.454 400.176,119.348 402.973,119.348C 405.433,119.348 407.561,119.454 409.35,119.667C 411.14,119.88 412.538,120.223 413.548,120.7C 414.553,121.177 415.282,121.733 415.73,122.369C 416.176,123.005 416.4,123.697 416.4,124.437L 416.4,314.339 Z "/>
<Path x:Name="Path_18" Width="147.333" Height="132.271" Canvas.Left="82.2323" Canvas.Top="37.888" Stretch="Fill" Fill="#FF646363" Data="F1 M 136.76,154.224C 134.533,155.585 132.348,156.081 129.798,156.736C 124.39,158.127 124.765,162.557 119.692,162.088C 111.589,161.332 112.453,149.339 110.476,157.269C 108.75,164.189 97.2237,168.549 97.2237,168.549L 88.6984,170.159L 82.5331,169.721C 82.5331,169.721 80.6917,167.737 86.1211,164.332C 90.8931,161.329 104.101,158.825 102.884,148.295C 102.352,143.713 105.917,138.209 103.109,129.123C 99.8797,118.68 100.38,93.6493 100.38,93.6493C 100.38,93.6493 110.43,113.664 112.23,109.152C 116.913,97.4146 126.677,102.949 129.786,99.4146C 145.58,81.4546 141.898,81.4146 151.901,71.568C 159.629,63.964 196.596,50.0999 198.374,49.8213C 204.52,48.8493 200.52,47.516 211.656,48.7747L 218.777,51.1667L 219.781,51.82L 216.268,48.5199L 217.796,47.1306L 211.89,45.908L 216.221,43.7573L 212.921,43.6239L 212.87,43.2773L 208.484,42.9027L 209.414,40.9226L 207.656,40.3906C 207.656,40.3906 233.152,29.0213 229.136,54.748C 225.884,75.6066 217.656,55.5573 222.964,65.8293C 236.986,92.94 212.658,111.539 212.658,111.539C 212.658,111.539 214.502,116.311 216.228,116.876C 217.964,117.437 220.464,121.385 217.442,124.492C 215.196,126.787 199.801,145.256 199.801,145.256C 199.801,145.256 195.34,152.027 194.364,153.279C 193.386,154.537 191.437,155.623 191.437,155.623L 187.874,154.973L 182.245,154.173C 182.496,150.647 207.84,124.429 202.114,125.057C 193.953,125.951 204.333,122.499 191.224,122.728C 179.789,122.936 165.012,155.239 161.788,161.313C 160.136,164.423 152.749,164.141 152.749,164.141C 152.749,164.141 145.761,162.376 149.348,156.804C 161.868,137.363 157.478,141.379 154.241,142.632C 145.252,146.116 150.984,135.163 144.98,144.919C 143.888,146.695 142.869,148.168 141.902,149.4C 141.902,149.4 143.368,151.152 143.869,154.661C 143.869,154.661 142.866,151.215 141.205,150.275L 140.484,151.027C 140.484,151.027 142.553,153.439 141.706,156.855C 141.706,156.855 141.488,152.907 139.638,151.747L 138.636,152.624C 138.636,152.624 141.268,155.601 139.92,158.892C 139.92,158.892 140.328,155.727 137.914,153.376L 136.76,154.224 Z "/>
<Path x:Name="Path_19" Width="8.16827" Height="10.698" Canvas.Left="108.634" Canvas.Top="134.882" Stretch="Fill" StrokeThickness="0.789334" StrokeMiterLimit="2.75" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 109.066,135.652C 108.439,133.987 116.008,138.403 116.008,138.403C 116.008,138.403 116.851,143.84 116.088,145.186L 112.176,141.708C 112.176,141.708 110.878,140.476 109.066,135.652 Z "/>
<Path x:Name="Path_20" Width="12.496" Height="8.72668" Canvas.Left="122.758" Canvas.Top="137.835" Stretch="Fill" StrokeThickness="0.789334" StrokeMiterLimit="2.75" Stroke="#FFAAC923" Fill="#FFAAC923" Data="F1 M 124.165,139.807C 123.218,140.751 123.153,146.167 123.153,146.167C 123.153,146.167 128.193,144.434 129.551,143.662C 130.973,142.853 134.859,138.23 134.859,138.23L 129.895,138.802C 129.895,138.802 124.797,139.179 124.165,139.807 Z "/>
<Path x:Name="Path_21" Width="13.7543" Height="22.72" Canvas.Left="142.932" Canvas.Top="102.056" Stretch="Fill" Fill="#FF646363" Data="F1 M 142.968,116.868C 142.12,112.526 156.687,102.056 156.687,102.056C 156.687,102.056 155.845,117.55 149.448,124.777"/>
<Path x:Name="Path_22" Width="18.2373" Height="28.3466" Canvas.Left="141.624" Canvas.Top="95.803" Stretch="Fill" Fill="#73FFFFFF" Data="F1 M 150.353,124.15L 149.524,122.99C 153.868,118.079 156.096,106.811 156.687,102.056C 150.871,106.566 143.532,114.368 143.887,116.194L 141.624,118.182C 144.217,112.298 153.905,103.523 157.489,100.944L 159.861,95.803L 157.868,101.83C 157.832,102.48 155.644,113.631 150.353,124.15 Z "/>
<Path x:Name="Path_23" Width="3.65601" Height="11.9413" Canvas.Left="99.7975" Canvas.Top="91.1354" Stretch="Fill" Fill="#FF646363" Data="F1 M 99.7975,91.1354L 102.02,101.798L 103.453,103.077L 99.7975,91.1354 Z "/>
</Canvas>
</Canvas>
</Viewbox>
</Canvas>
</Canvas>
</Application.Resources>
答案 0 :(得分:0)
在你的情况下,ViewBox
可能代替ContentPresenter
<Canvas HorizontalAlignment="Left" Height="57" Margin="22,0,0,18" VerticalAlignment="Bottom" Width="112">
<Viewbox Child="{StaticResource LynxLogo}" Stretch="Uniform" Width="112" Height="57" />
</Canvas>
使用DropShadow
Effect
:)
<Canvas HorizontalAlignment="Left" Height="57" Margin="22,0,0,18" VerticalAlignment="Bottom" Width="112">
<Viewbox Child="{StaticResource tete}" Stretch="Fill" Width="120" Height="70" />
<Canvas.Effect>
<DropShadowEffect ShadowDepth="3" Direction="220"/>
</Canvas.Effect>
</Canvas>