我不知道如何将opencv::Mat
转换为podofo::PdfImage
或如何解决崩溃。我很困惑。
我的代码:
// Mat img
// ...do something to init 'img'...
int image_size = img.cols * img.rows;
unsigned char* outBuffer = new unsigned char[image_size];
memcpy(outBuffer, sub_img[0].data, image_size);
//imwrite(".\\71253_0_0.png",img); // can be saved and displayed correctly
PdfImage pdfimg( &document );
pdfimg.LoadFromData(img.data,image_size); **//cause a crash**