From: Noel O'B. <bao...@gm...> - 2011-05-14 17:38:07
|
After googling, I see that RMagick may be a better way to convert from SVG to PNG from Ruby. - Noel On 14 May 2011 18:32, Noel O'Boyle <bao...@gm...> wrote: > Rather than use OBPainter or OBDepict, why not convert to SVG as > normal, and then use a cairo interface to draw as a PNG. This is what > I am doing for the python interface, eg. > > import cairo > import rsvg > > h = rsvg.Handle("test.svg") > s = cairo.ImageSurface(cairo.FORMAT_ARGB32, 100, 100) > ctx = cairo.Context(s) > h.render_cairo(ctx) > s.write_to_png("test.png") > > These are GTK libraries. Maybe you can find similar libraries in Ruby? > > - Noel > > On 11 May 2011 11:50, Christoph Helma <he...@in...> wrote: >> I wanted to substitute CDK/JChemPaint with OBDepict in our ruby based >> webservices, but it seems that OBDepict (and also OBPaint) do not have >> ruby bindings (other classes like OBMol or OBConversion work fine): >> >> depict = OpenBabel::OBDepict.new >> NameError: uninitialized constant OpenBabel::OBDepict >> from (irb):1 >> >> It seems that OBDepict is missing from scripts/ruby/openbabel-ruby.cpp >> which changes would I need to make to create ruby bindings for OBDepict >> (my SWIG knowledge is rather weak)? >> >> Best regards, >> Christoph >> >> PS: I also had to change Init_OpenBabel to Init_openbabel at line 49795 >> of openbabel-ruby.cpp. This problem has been fixed in OpenBabel 2.2.3, >> but it reappeared in 2.3.0 >> >> ------------------------------------------------------------------------------ >> Achieve unprecedented app performance and reliability >> What every C/C++ and Fortran developer should know. >> Learn how Intel has extended the reach of its next-generation tools >> to help boost performance applications - inlcuding clusters. >> http://p.sf.net/sfu/intel-dev2devmay >> _______________________________________________ >> OpenBabel-scripting mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> > |