In general, there is a certain image (file), but Image does not want to display it. Here is the code with which I am trying to display an image:
BitmapImage bitmp = new BitmapImage(); bitmp.BeginInit(); bitmp.UriSource = new Uri(file, UriKind.Relative); bitmp.CacheOption = BitmapCacheOption.OnLoad; bitmp.EndInit(); return bitmp; ImageSource is returned. What could be wrong here? The returned image is placed in the Image.Source. I tried to set the relative and absolute Uri, but this did not change the situation.
file? - VladDimgres\somefile.png, and in output, theSystem.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'System.Threading.Tasks.Task 1[System.Windows.Media.ImageSource]' and 'System.Windows.Media.ImageSource'. Consider using Converter property of Binding. BindingExpression:Path=PlayerIcon; DataItem='<>f__AnonymousType6 8' (HashCode=144639410); target element is 'Image' (Name=''); target property is 'Source' (type 'ImageSource')- Rupppppppet