-2
如何解決System.Drawing中參數無效 當我使用代碼:如何解決System.Drawing中 - 參數無效
string img2 = "http://13.228.146.249:8080/jcr/groups/629.png;
byte[] toBytes = Encoding.ASCII.GetBytes(img2);
if (toBytes != null)
{
MemoryStream ms = new MemoryStream(toBytes);
ms.Position = 0;
picboxserver.Image = Image.FromStream(ms);
}
picboxserver是PictureBox的類型。
您試圖將URL字符串作爲圖像,而不是位於該URL的數據。 –
picboxserver.ImageLocation = img2; –