[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

TkCanvas

Patrick Lynch

12/19/2006 12:42:00 PM

Good morning,
I'm trying to translate the example on pp 341-345 in "Mastering Perl/TK'
to Ruby.

On page 344 a method $cp->CreatePlotAxis(...) is used. Is there a method
in TkCanvas that I can use that will produce the same result, namely,
placing labels on the x axis and y axis?

Thx,
Pat

--
Posted via http://www.ruby-....

4 Answers

Mihai Frisan

12/19/2006 1:13:00 PM

0

Hello,

I try to edit a .svg file with RMagick, but the result of just importing
the file and then saving it as a .jpg is a black&white image (the shapes
are still there but the colors are not).
Here is the code

require 'RMagick'
include Magick

canvas = Image.read('d:\test.svg').first
canvas.write('d:\test.jpg')

Any pointers will be greatly appreciated.
If you know any other way (another image library maybe) I can edit a
svg file from ruby please let me know.

Thanks,
Mihai


Tim Hunter

12/19/2006 2:14:00 PM

0

Mihai Frisan wrote:
> Hello,
>
> I try to edit a .svg file with RMagick, but the result of just
> importing the file and then saving it as a .jpg is a black&white image
> (the shapes are still there but the colors are not).
> Here is the code
>
> require 'RMagick'
> include Magick
>
> canvas = Image.read('d:\test.svg').first
> canvas.write('d:\test.jpg')
>
> Any pointers will be greatly appreciated.
> If you know any other way (another image library maybe) I can edit a
> .svg file from ruby please let me know.
>
> Thanks,
> Mihai
>
>
ImageMagick's support for SVG is long overdue for an overhaul and you'll
probably never get satisfactory results. If you want an authoritative
response for this particular image, probably your best bet is to open a
Support Request on the RMagick RubyForge project
(http://rubyforge.org/tracker/?g...). You'll be able to upload
your .svg file as part of the request. Don't forget to specify which
version of RMagick you're using.

Tim Hunter

12/19/2006 3:57:00 PM

0

Mihai Frisan wrote:
> Hello,
>
> I try to edit a .svg file with RMagick, but the result of just
> importing the file and then saving it as a .jpg is a black&white image
> (the shapes are still there but the colors are not).
> Here is the code
>
> require 'RMagick'
> include Magick
>
> canvas = Image.read('d:\test.svg').first
> canvas.write('d:\test.jpg')
>
> Any pointers will be greatly appreciated.
> If you know any other way (another image library maybe) I can edit a
> .svg file from ruby please let me know.
>
> Thanks,
> Mihai
>
>
Mihai,

I see your Support Request on RubyForge. Could you please attach the
problem SVG file to the request? If you scroll all the way to the bottom
of the page you'll see a checkbox that says "Check to Upload & Attach
File" and a place to select the file. Thanks!

Morton Goldberg

12/20/2006 11:27:00 AM

0

On Dec 19, 2006, at 7:41 AM, Patrick Lynch wrote:

> Good morning,
> I'm trying to translate the example on pp 341-345 in "Mastering
> Perl/TK'
> to Ruby.
>
> On page 344 a method $cp->CreatePlotAxis(...) is used. Is there a
> method
> in TkCanvas that I can use that will produce the same result, namely,
> placing labels on the x axis and y axis?

Uh, didn't we go through this back is September? And didn't you get a
detailed answer from Hidetoshi NAGAI? I can only refer you to:

http://www.code-hosting.com/Ruby/1508039-Ca...
createPlotAxis-and-createLinePlot-

AFAIK, there is no one more expert in this area than NAGAI san. I
don't think you are going to get a better answer than you already got.

Regards, Morton