<div dir="ltr">Hi all,<br><br><br>I am trying to use a vtkJPEGImageWriter to write a JPEG file to memory (instead of writing to disk and then reading it again using fopen or similar) in C++.<br><br><br>To do this I believe I need something like the following:<br><br>----<br>vtkSmartPointer<vtkJPEGWriter> writer = vtkSmartPointer<vtkJPEGWriter>::New();<br>writer->SetWriteToMemory(true);<br>writer->SetInputData(...);<br>writer->Write();<br><br>vtkUnsignedCharArray* d = writer->GetResult();<br>----<br><br><br>However at this point I don't know how to extract what I need from the vtkUnsignedCharArray. I would like the raw bytes and size, like so:<br><br><br>----<br>char* data = d->...<br>size_t size = d->...<br>----<br><br><br><br>But I am not sure how to do this. Any help would be greatly appreciated :)<br><br><br>Thanks,<br>Andrew Higginson</div><div dir="ltr">-- <br></div><p dir="ltr"></p>
<p dir="ltr">Andrew Higginson</p>