Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - libimg how to encode png to memory: (1 Item)
   
libimg how to encode png to memory  
Hi 
    In my case, I want to encode a pixel buffer into a piece of memory in png format.I just write the code:

			BYTE* pbtBuffer		= new BYTE[img.w * img.h];
			s_writeBufferSize	        = img.w * img.h;

			io_stream_t* pOutStream = io_open( IO_MEM, IO_WRITE, img.w * img.h, pbtBuffer );
			if ( !pOutStream )
			{
				CLogApp::info( String::format( L"io_open error: %d", errno ) );
				return FALSE;
			}

			pOutStream->output.write_f = ioMemoryWrite;

But I cannot  do io_open( IO_MEM...) with IO_WRITE.  I search the history and find that qnx not support the write mode 
with io_mem. 
How can I do this. Can someone help me? Thanks!!!!!!!!!!!!