Greg,

Thank you very much for your help.  Everything works perfectly and you 
are right, it is much simpler than before.  If you have time to 
implement drawing on a non-white canvas it would be a great feature.  
Otherwise, no big deal.

Thanks again.

Don

On 06/10/2011 09:28 PM, Greg Landrum wrote:
> Hi Don,
>
> On Sat, Jun 11, 2011 at 12:32 AM, Donald Keidel<donald.kei...@gmail.com>  
> wrote:
>> Hi,
>>
>> Today I checked out the lastest version from the svn.  I took only the
>> trunk and built this and ran a python script I used with a previous
>> version to depict a molecule.  However, I received the following error:
>>
>> AttributeError: type object 'MolDrawing' has no attribute 'registerCanvas'
>>
> the registerCanvas() function was removed in the Q1 2011 release. I
> forgot to mention this specifically in the release notes (they only
> mention that the drawing code has been refactored).
>
>> I did the following in the python script much like the people at cinfony
>> do to depict with aggdraw:
>>
>     <snip>
>
> There were a number of changes to the drawing interface that make what
> you want to do somewhat easier. The biggest one is that
> Draw.MolToImage will automatically take care of finding a working
> canvas and will return a PIL image that you can use in the rest of
> what you're doing. I'm attaching a version of your code that works for
> at least simple stuff, you should definitely go through it and make
> sure everything is really ok. One expansion in capability you may or
> may not want: this no longer requires aggdraw. It tries cairo, then
> aggdraw, then sping (built in). If you want to force use of aggdraw,
> add at the top of the file:
> import os
> os.environ['RDKIT_CANVAS']='agg'
>
> One big caveat: drawing on a non-white background doesn't work. It
> didn't work before either, so this is nothing new. If there's a real
> demand for this feature, it can be added to a future RDKit release.
>
> -greg

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to