[vtkusers] Loading Images from Memory

Mathieu Bosi mathieu.bosi at gmail.com
Thu Mar 9 12:28:37 EST 2006


Hi to everyone, my name is Mathieu Bosi.

I'm new to vtk and currently I'm facing with this Issue:
I have to load a geric image (i.e. PNG) from a compressed archive and
currently I'm able to extract the file to memory.
Is it actually possible to load an image from a "memory file"?

More precisely I would like to achieve something like this:

----------------------------

int size; // how many bytes we'll have in mem_ptr[]

byte *mem_ptr = feedFromArchive( archive_file_name, file_name_in_archive,
&size );

vtkPNGReader  *png_reader  = vtkPNGReader::New();

png_reader->SetMemFile( mem_ptr, size ); // <-- Versus --> the file
version:  png_reader->SetFileName( img_file_name );
png_reader->Update();

----------------------------

Actually the only (rude) way I've found is to dump from the memory to a
temporary file and then passing that file name as a parameter to the
canonical "vtkPNGReader::SetFileName()" is that the only solution?


Thanks in advance for your kind attention

 - Mathieu Bosi -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060309/ecae5b02/attachment.htm>


More information about the vtkusers mailing list