On 06/13/2013 04:05 PM, Matt Berlin wrote:
> Specifying the writefile as *.png works just great, thanks. As far as
> writing to a string and converting this into a picture without an
> intervening file, this is very confusing to me. I assume I would use
> image.fromstream() somehow, but I don't know how to create a stream from a
> string. If you could give me some example code for this in any language,
> that would help a lot. I'm a chemist trying to program, not the other way
> around, and certainly appreciate your help.

C++ would look something like

#include <sstream>

std::stringstream out;
OBConversion obc;

obc.SetOutStream( out );
...

out.str() returns std::string and out.str().c_str() will give you
null-terminated char array (aka c-style string).

-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to