6
วิธีการสร้างอาร์เรย์ไบต์จาก HttpPostedFile
ฉันใช้องค์ประกอบภาพที่มีวิธีการ FromBinary สงสัยว่าฉันจะแปลงสตรีมอินพุตเป็นอาร์เรย์ไบต์ได้อย่างไร HttpPostedFile file = context.Request.Files[0]; byte[] buffer = new byte[file.ContentLength]; file.InputStream.Read(buffer, 0, file.ContentLength); ImageElement image = ImageElement.FromBinary(byteArray);