如何将图像添加到画布?我试过了,但图像没有出现
XAML
<Canvas x:Name="Row3" Canvas.Top="140" Canvas.Left="220" Height="400" Width="80">
<Border Height="100" Width="70" BorderBrush="Gray" BorderThickness="3" />
</Canvas>
C#
Image test = new Image ();
BitmapImage b = new BitmapImage();
b.UriSource = new Uri("/Asstes/Deck/34.png", UriKind.Relative);
test.Source = b;
test.Height = 100;
test.Width = 70;
Row3.Children.Add(test);