HttpRequest req = new HttpRequest(imageName, "http://panonest.com", "");
var imgSrc=req.MapPath("~/view/vacantapredeal/vacantapredeal.jpg");
Bitmap img = new Bitmap(imgSrc);
어떻게해야합니까? 매개 변수가 Bitmap
생성자에 의해 throw되는 유효한 예외가 아닙니다.서버에서 파일에서 비트 맵을 만드는 방법 - 매개 변수가 유효하지 않습니다.
WebClient MyWebClient = new WebClient();
byte[] BytesImage = MyWebClient.DownloadData("http://www.google.com/intl/en_com/images/srpr/logo3w.png");
System.IO.MemoryStream iStream= new System.IO.MemoryStream(BytesImage);
System.Drawing.Bitmap b = new System.Drawing.Bitmap(iStream);
행운을 빕니다 :
나는 downloaddata ideea를 좋아한다. 그냥 질문 : 내 이미지와 코드가 같은 서버에 있다면 더 많은 시간이 필요하거나 Kelsey의 대답과 동일할까요? – Ryan
이미지가 서버에있는 경우 모든 유형의 HTTP 요청을 만들지 않으므로 welh Kelsey의 대답을 참조하십시오. –