OEImageBase *OECreateWin32GraphicsImage(OESystem::OESharedPtr<Gdiplus::Graphics> &graphics)
This function is only available on the Windows operating system through C++.
Returns an new OEImageBase pointer that will forward all the draw commands to the passed in Gdiplus::Graphics object. The user is expected to take ownership and delete the OEImageBase pointer. The OEImageBase will share ownership of the passed in graphics object. It important that the user does not destroy the Gdiplus::Graphics object before the OEImageBase is done with it.
The following code demonstrates how to interact with this function:
ULONG_PTR gdiplusToken; Gdiplus::GdiplusStartupInput startupInput; GdiplusStartup(&gdiplusToken, &startupInput, NULL); OEOwnedPtr<Gdiplus::Bitmap> bitmap(new Bitmap(200, 100, PixelFormat32bppARGB)); OESharedPtr<Gdiplus::Graphics> graphics(new Graphics(bitmap)); OEOwnedPtr<OEImageBase> img = OECreateWin32GraphicsImage(graphics); OEMol mol; OESmilesToMol(mol, "c1ccccc1 benzene"); OEPrepareDepiction(mol); OERenderMolecule(*img, mol);