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