1
바이트 배열을 이미지 유형으로 변환해야합니다. 내 바이트 배열 원시 이미지가 포함되어 있으며 이미지가 유효합니다. 나는 인터넷에서 모든 솔루션을 시도했지만 여전히 오류 얻고있다 :매개 변수가 MemoryStream을 사용하여 유효하지 않습니다.
byte[] arr = File.ReadAllBytes(@"C:\Users\aa\Desktop\Image.raw");
MemoryStream ms = new MemoryStream(arr,0,arr.Length);
ms.Seek(0, SeekOrigin.Begin);
Image img = Image.FromStream(ms);
ms.Dispose();
나는 또한 함께 시도 :
이using(MemoryStream ms = new MemoryStream(arr,0,arr.Length))
{
//my code
}
GDI +가 RAW 이미지 파일을 읽는 방법을 알고 있는지 잘 모르겠습니다. 별도의 라이브러리가 필요할 수 있습니다. http://stackoverflow.com/questions/227604/reading-raw-image-files-as-gdi-bitmaps – acfrancis
이미지의 크기는 어느 정도입니까? – Bas