The given System.Uri cannot be converted into a Windows.Foundation.Uri

后端 未结 7 1926
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 10:47

I\'m trying to programmatically load a BitmapImage in a XAML Metro app. Here\'s my code:

var uri = new Uri(\"/Images/800x600/BackgroundTile.bmp\", UriKind.Re         


        
相关标签:
7条回答
  • 2020-12-01 11:23

    I know this is old but I hope this helps. I wrote this in XAML and it worked for me. The Ide I'm using is vs-2015 with win-10.

    <Window>
    <Grid>
    <Grid.Background>
    <ImageBrush ImageSource="NameOfYourImage.JPG or any Image type"/>
    </Grid.Background>
    <GroupBox x:Name="groupBox" Header="GroupBox" HorizontalAlignment="Left"   Height="248" Margin="58,33,0,0" VerticalAlignment="Top" Width="411">
    <GroupBox.Background>
    <ImageBrush ImageSource="NameOfYourImage.JPG or any Image type"/>
    </GroupBox.Background>
    </GroupBox>
    </Grid>
    </Window>
    
    0 讨论(0)
提交回复
热议问题