Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
来自C#XAML的图像源_Xaml_Windows Phone - Fatal编程技术网

来自C#XAML的图像源

来自C#XAML的图像源,xaml,windows-phone,Xaml,Windows Phone,我需要从C#设置图像源。我尝试了X:Name=“headimg”,但在C#中找不到headimg 试试这个: public void SetImage() { BitmapImage imge = new BitmapImage(new Uri("/Assets/Images/ImageName.png", UriKind.Relative)); headimg.Source=image.Source; } public void SetImage() { Bitma

我需要从C#设置图像源。我尝试了
X:Name=“headimg”
,但在C#中找不到headimg


试试这个:

public void SetImage()
{
    BitmapImage imge = new BitmapImage(new Uri("/Assets/Images/ImageName.png", UriKind.Relative));
    headimg.Source=image.Source;
}
public void SetImage()
{
    BitmapImage imge = new BitmapImage(new Uri("/Assets/Images/ImageName.png", UriKind.Relative));
    headimg.Source=image.Source;
}