안녕하세요, 관리되지 않는 이미지를 picturebox에 표시해야하는 관리되는 비트 맵 이미지로 변환해야하지만 "개체 참조가 개체의 인스턴스로 설정되지 않았습니다"라는 예외를 throw하는 것으로 보입니다. 누구든지 그것에 대해 생각하고 있습니까? 예외를 throw하는 줄을 주석 처리했습니다.관리되지 않는 이미지를 관리되는 비트 맵 이미지로 변환하는 방법?
for (int i = 0; i < characters.Length; i++)
{
area = characters[i].Area;
UnmanagedImage numer = characters[i].Image;
System.Drawing.Image plateImage = numer.ToManagedImage();//Exception
numberplate = new Bitmap(new Bitmap(plateImage));
pictureBox2.Image = numberplate;
pictureBox2.Refresh();
}
전 C#과
UPDATE
for (int i = 0; i < characters.Length; i++)
{
area = characters[i].Area;
Bitmap numer = characters[i].Image.ToManagedImage();
//System.Drawing.Image plateImage = numer.ToManagedImage();
//numberplate = new Bitmap(new Bitmap(plateImage));
pictureBox2.Image = numberplate;
pictureBox2.Refresh();
}
'numer'가 null임을 의미합니다. – logicnp
'characters' 배열은 어떤 타입입니까? –
[API 문서] (http://www.aforgenet.com/framework/docs/html/2e7a1649-557d-d716-637d-29ec276603c8.htm)에 따르면 'Blob.Image'는 'null'일 수 있으며 이 경우에는 BlobCounter.ExtractBlobsImage 오버로드로 시도 할 수 있습니다. –