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:

OEGraphMol mol = new OEGraphMol();
OEChem.OESmilesToMol(mol, "c1ccccc1");
OEDepict.OEPrepareDepiction(mol);

OEImage image = new OEImage(200, 200);
OEDepict.OERenderMolecule(image, mol);
byte [] bytes = OEDepict.OEWriteImageToByteArray("svg", image);

See also