我的资源目录中有4个图像,它们位于我的便携式项目中,我想直接使用它们作为ImageSource(因为我需要绑定它)。
ImageSource myImageSource = ImageSource.FromResource("resources.image.png");
我尝试了这个,但它无法识别路径。我如何使用我的图片作为ImageSource?
我的资源目录中有4个图像,它们位于我的便携式项目中,我想直接使用它们作为ImageSource(因为我需要绑定它)。
ImageSource myImageSource = ImageSource.FromResource("resources.image.png");
好的,我的错误,我忘记了把我的项目名称放在资源目录之前。
ImageSource myImageSource = ImageSource.FromResource("NameOfProject.Resources.image.png");