byte[] imageData = null;
long byteSize = 0;
byteSize = _reader.GetBytes(_reader.GetOrdinal(sFieldName), 0, null, 0, 0);
imageData = new byte[byteSize];
long bytesread = 0;
int curpos = 0, chunkSize = 500;
while (bytesread < byteSize)
{
// chunkSize is an arbitrary application defined value
bytesread += _reader.GetBytes(_reader.GetOrdinal(sFieldName), curpos, imageData, curpos, chunkSize);
curpos += chunkSize;
}
byte[] imgData = imageData;
MemoryStream ms = new MemoryStream(imgData);
Image oImage = Image.FromStream((Stream)ms);
return oImage;
"Image oImage = Image.FromStream((Stream)ms);"
라인이 실행될 때 코드가 생성됩니다 .....이 라인은 "Parameter is not valid"
메시지를 보여줍니다 ....... 왜 발생합니까? 도와주세요. 데이터베이스에서 이미지를 가져오고 싶습니다 .... C# window vs05 .....에 대한 작업 중 하나가 도와 줄 수 있습니까? byte [] 값을 포함합니다. 모든 것이 잘 작동하지만이 줄이 실행될 때 문제가 발생합니다.이미지 검색은 C#
당신 되세요 바이트 배열이하는 것을 확인 실제로 데이터가 포함되어 있습니까? –