OEWriteImageToStringΒΆ

std::string OEWriteImageToString(const std::string &ext,
                                 const OEImage &image)

Writes the image into a string.

ext
The extension which determine the type of the image.
image
The OEImage object which is being written into the string.

Example:

mol = OEGraphMol()
OESmilesToMol(mol, "c1ccccc1")
OEPrepareDepiction(mol)

image = OEImage(200, 200)
OERenderMolecule(image, mol)
data = OEWriteImageToString("svg", image)

Warning

In Python 3 the OEWriteImageToString function returns bytes.

See also