Dynamic Image?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cybex

    Dynamic Image?

    Who knows how this is done:



    As you can see the signature is dynamical, it uses gdlib I assume and php.
    But does anybody have any code for this? Please help me find this, I
    allready searched alot, but can't seem to find anything yet...

    Regards, Cybex


  • Shawn Wilson

    #2
    Re: Dynamic Image?

    Cybex wrote:[color=blue]
    >
    > Who knows how this is done:
    >
    > http://www.danasoft.com/vipersig.jpg
    >
    > As you can see the signature is dynamical, it uses gdlib I assume and php.
    > But does anybody have any code for this? Please help me find this, I
    > allready searched alot, but can't seem to find anything yet...
    >
    > Regards, Cybex[/color]

    ImageMagick would work well for this, if it's installed on your server.
    If you have Telnet or SSH:
    whereis ImageMagick
    will tell you where it is.

    Shawn
    --
    Shawn Wilson
    shawn@glassgian t.com

    Comment

    • Richard Hockey

      #3
      Re: Dynamic Image?


      "Cybex" <cybex.Ihatespa m@home.nl> wrote in message
      news:biijn1$887 $1@news1.tilbu1 .nb.home.nl...[color=blue]
      > Who knows how this is done:
      >
      > http://www.danasoft.com/vipersig.jpg
      >
      > As you can see the signature is dynamical, it uses gdlib I assume and php.
      > But does anybody have any code for this? Please help me find this, I
      > allready searched alot, but can't seem to find anything yet...[/color]

      PHP to generate a horizontal bar graphic in a PNG file when called with a
      URL parameter 'precent'

      makepng.php
      <?php
      // read url parameter 'percent'
      $percent=$_GET["percent"];
      // calculate size of bar
      $x1=floor(460*( $percent/100));

      // build image
      $im = ImageCreate(500 , 50);

      // set colours, first colour created is background
      $black = ImageColorAlloc ate($im, 0, 0, 0);
      $white = ImageColorAlloc ate($im, 255, 255, 255);
      $red = ImageColorAlloc ate($im, 255, 0, 0);

      // set up array defining vertices of hexagonal bar, width depends on
      'percent' parameter
      $points=array(1 0,25,20,45,($x1 +20),45,($x1+30 ),25,($x1+20),5 ,20,5);

      // draw polygon using array 'points' and colour red
      imagefilledpoly gon($im,$points ,6,$red);

      // write text on top of bar
      imagestring($im ,5,20,20,$perce nt.'%',$white);

      // send the image to the browser
      header("Content-type: image/png");
      ImagePNG($im);

      // tidy up
      ImageDestroy($i m);
      ?>

      and an example of a page using the above code

      <html>
      <head>
      <title>dynami c image</title>
      <script type="text/javascript">
      function graph(gaugeID)
      {
      var n=20;
      var time=new Date();
      var n=time.getSecon ds();
      n=Math.floor((n *100)/60);

      document.getEle mentById(gaugeI D).src='makepng .php?percent='+ n;
      var temp=setTimeout ("VUgauge('gaug e1')",1000);
      }
      </script>
      </head>
      <body onload="graph(' placeholder');" >
      <img id="placeholder ">
      </body>
      </html>
      [color=blue]
      > Regards, Cybex
      >
      >[/color]


      Comment

      Working...