Hello, i have problem with get model preview image. I used On_WindowsBitmap from openNURBS and his functions Read and Write. But the result is not a picture that i can write as image (Viewer said that its damaged). There is part of my code. Can u advice me please?
NSString *filePath = [NSString stringWithFormat:@"%@/%@", [localDocumentsDirectoryURL path], @"preview.bmp"]; FILE *fp = ON::OpenFile([filePath UTF8String], "wb"); ON_WindowsBitmap bitmap; Read3dmThumbnailPreviewImage([[model documentsFilename] UTF8String], bitmap); ON_BinaryFile file(ON::write, fp); bitmap.Write(file); ON::CloseFile(fp);