OERenderMoleculeToString¶
Link |
Description |
---|---|
writes a molecule display into a string (byte array) |
|
writes a molecule into a string (byte array) using the default depiction style |
std::string OERenderMoleculeToString(const std::string &ext, const OE2DMolDisplay &disp, bool clearbackground=true)Writes a molecule display into a string.
- ext
The extension which determine the type of the image.
- disp
The OE2DMolDisplay object that holds the data necessary to depict the molecule with which it is initialized.
- clearbackground
Determines whether or not the image is cleared (by calling
OEImageBase::Clear
method) prior to the molecule rendering.See also
OEIsRegisteredImageFile
function
std::string OERenderMoleculeToString(const std::string &ext, const OEChem::OEMolBase &mol, bool clearbackground=true)Writes a molecule into a string using the default depiction style.
- ext
The extension which determine the type of the image.
- mol
The molecule being rendered.
- clearbackground
Determines whether or not the image is cleared (by calling
OEImageBase::Clear
method) prior to the molecule rendering.Example:
OEGraphMol mol; OESmilesToMol(mol, "c1ccccc1"); OEPrepareDepiction(mol); std::string data = OERenderMoleculeToString("svg", mol);See also
OEIsRegisteredImageFile
function