Fit image to border background

前端 未结 1 1758
轻奢々
轻奢々 2021-01-27 21:47

may i know how can fit the image into the designed border?

below are the code that i\'ve done.

 

        
相关标签:
1条回答
  • 2021-01-27 22:16

    It is possible to set the <Border.Background/> property to an <ImageBrush/> like:

    <Border Grid.Row="1" BorderThickness="1" BorderBrush="LightGreen" Margin="20" CornerRadius="30">
         <Border.Background>
              <ImageBrush Stretch="UniformToFill" ImageSource="/LBKIOSK;component/Resources/Images/Background/klhoho.jpg"/>
         </Border.Background>
         <Border.Effect>
              <DropShadowEffect ShadowDepth="5" Color="#599204"></DropShadowEffect>
         </Border.Effect>
    </Border>
    
    0 讨论(0)
提交回复
热议问题