I want to save an array to an image as TIFF, The code as follow imgConvert->IEBitmap->Height = ImgHeight; imgConvert->IEBitmap->Width = ImgWidth; imgConvert->LegacyBitmap = false; // Do not use TBitmap // imgConvert->IEBitmap->Location = ieFile;
imgConvert->IEBitmap->PixelFormat = ie32f; imgConvert->IO->Params->BitsPerSample = 32; imgConvert->IO->Params->SamplesPerPixel = 1; imgConvert->IO->Params->TIFF_PhotometInterpret = ioTIFF_BLACKISZERO; imgConvert->IO->Params->TIFF_Compression = ioTIFF_UNCOMPRESSED;
float *P32; for (int i = 0; i < ImgHeight; i++) { P32 = (float*)imgConvert->IEBitmap->Scanline[i]; for (int j = 0; j < ImgWidth; j++) { P32[j] = IctData[i*ImgWidth + j] /255.0; } } imgConvert->IO->SaveToFileTIFF(OutputFilename); The code can compile successfully, but run to SaveToFileTIFF, the error will occur as follow:
|