Professional Web Applications Themes

advice needed on using proper perl graphics module(s) - PERL Modules

I am starter on graphics programming. I got both books "Graphics Programming with Perl" (by Martien Verbruggen) and "Perl Graphics Programming" (by Shawn Wallace) but still have difficulties to figure out how to draw a simple graph like in this example: [url]http://www.genome.iastate.edu/~hu/example.jpg[/url] (horizontal distances are not critical and should be self-scalable but vertical positions should be precise). I tried out examples in the books as well as found on various web sites -- they work great in the way "they were designed for". I tried to twick the codes for what I intended to let it do ... without luck ...

  1. #1

    Default advice needed on using proper perl graphics module(s)

    I am starter on graphics programming. I got both books "Graphics
    Programming with Perl" (by Martien Verbruggen) and "Perl Graphics
    Programming" (by Shawn Wallace) but still have difficulties to figure
    out how to draw a simple graph like in this example:
    [url]http://www.genome.iastate.edu/~hu/example.jpg[/url] (horizontal distances
    are not critical and should be self-scalable but vertical positions
    should be precise).

    I tried out examples in the books as well as found on various web
    sites -- they work great in the way "they were designed for". I tried
    to twick the codes for what I intended to let it do ... without luck
    to get anything close to what I wanted. Could someone kindly suggest
    a right module and perhaps with hints to help me get started on right
    track?

    Thanks in advance!

    Zhiliang
    Zhiliang Hu Guest

  2. #2

    Default Re: advice needed on using proper perl graphics module(s)

    I found simply use "GD" is a good start for my purpose (I went too far
    as to try GD::Graph::lines etc among others).

    However I have a further question: to build hyperlinks for certain
    texts/areas on an image made on-the-fly, is there anything else
    besides using "image map"?

    Zhiliang


    [email]zhilianghu[/email] (Zhiliang Hu) wrote in message news:<1daf0582.0411041202.7502c800posting.google. com>...
    > I am starter on graphics programming. I got both books "Graphics
    > Programming with Perl" (by Martien Verbruggen) and "Perl Graphics
    > Programming" (by Shawn Wallace) but still have difficulties to figure
    > out how to draw a simple graph like in this example:
    > [url]http://www.genome.iastate.edu/~hu/example.jpg[/url] (horizontal distances
    > are not critical and should be self-scalable but vertical positions
    > should be precise).
    >
    > I tried out examples in the books as well as found on various web
    > sites -- they work great in the way "they were designed for". I tried
    > to twick the codes for what I intended to let it do ... without luck
    > to get anything close to what I wanted. Could someone kindly suggest
    > a right module and perhaps with hints to help me get started on right
    > track?
    >
    > Thanks in advance!
    >
    > Zhiliang
    Zhiliang Hu Guest

  3. #3

    Default Re: advice needed on using proper perl graphics module(s)

    I am testing on a simple perl using GD as following:

    #!/usr/bin/perl
    use GD;
    my $newimg = GD::Image->new(400,400,$yellow);
    my $white = $newimg->colorAllocate(255, 255, 255); #<--See comment
    my $black = $newimg->colorAllocate( 0, 0, 0);
    my $red = $newimg->colorAllocate(255, 0, 0);
    my $blue = $newimg->colorAllocate( 0, 0, 255);
    $newimg->rectangle(0, 0, 399, 399, $red);
    $newimg->line(80, 29, 85, 29, $black);
    $newimg->line(80, 19, 80, 393, $black);
    print "Content-type: image/png\n\n";
    print $newimg->png;

    -- It seems the first "colorAllocate" line in the program determines
    the background color? I switched the "colorAllocate" lines - the
    background color always follows that of the *first colorAllocate
    line". I have not found it doented somewhere. I thought there
    should be more obvious way to set background color ...

    Is this the way it should be? Any comments?

    Zhiliang
    Zhiliang Hu Guest

Similar Threads

  1. advice needed
    By Kevin Mark in forum Macromedia Flash Actionscript
    Replies: 25
    Last Post: March 11th, 03:13 AM
  2. Help needed with a treemenu based on graphics.
    By keiTai in forum Macromedia Director Basics
    Replies: 0
    Last Post: April 27th, 03:48 PM
  3. RESOLUTION: Using CPAN.PM on Win32: How Direct to Proper Perl Location
    By mcdavis941@netscape.net in forum PERL Beginners
    Replies: 0
    Last Post: January 30th, 06:27 PM
  4. Using CPAN.PM on Win32: How Direct to Proper Perl Location
    By mcdavis941@netscape.net in forum PERL Beginners
    Replies: 0
    Last Post: January 25th, 12:33 PM
  5. Proper way to export structures from a module
    By Steven Kuo in forum PERL Miscellaneous
    Replies: 1
    Last Post: August 24th, 05:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139