C
C#2y ago
Boggo

❔ Image.FromStream

i have this code (below) that im 99% sure was working before, now testing again is giving an error thrown my the Image.FromStream Class
6 Replies
Boggo
BoggoOP2y ago
private async void ChangeFlag(string country)
{
var httpClient = new HttpClient();
var response = await httpClient.GetStreamAsync($"https://countryflagsapi.com/png/{country}");
CountryFlagPB.BackgroundImage = (Bitmap)Image.FromStream(response);
}
private async void ChangeFlag(string country)
{
var httpClient = new HttpClient();
var response = await httpClient.GetStreamAsync($"https://countryflagsapi.com/png/{country}");
CountryFlagPB.BackgroundImage = (Bitmap)Image.FromStream(response);
}
Tells me Parameter is not valid
Boggo
BoggoOP2y ago
Amos
Amos2y ago
which parameter?
Boggo
BoggoOP2y ago
(Bitmap)Image.FromStream(response)
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server