FW:OT - web generator

Antala Mario Mario.Antala na swh.sk
Čtvrtek Červenec 18 09:54:06 CEST 2002


 
-----BEGIN PGP SIGNED MESSAGE-----

     zdravim,
 
 potreboval by spravit generator webovych buttonov, ktory by mal
 fungovat
 tak, ze user si naklika nejaky farebny template buttonu, do nejakeho
 text fieldu si napise text, ktory ma ten button obsahovat a nasledne
 sa 
 mu vygeneruje dany button. 
 myslim, ze je ocividne, kde je problem :-)
 google nasiel Imagemagick package, ktory to zvlada, ale vysledok nie
 je dostatocne dobry. neviete niekto o nejakom dalsom spuosobe ako to
 vyriesit?
 
 v podstate potrebujem 2 typy riesenia: 
 1. serverove (zeby cez servlety?, prip. cez cgi, php, neslo by to
 nahodou pod linuxom? niekde som svojho casu na webe nieco take
 videl (script), ale uz to neviem najst)
 
 2. lokalne: cez WebStart sa aplikacia stiahne na uzivatelov computer
 a tam sa spusti.
 
 
 question: zostava mi nieco ine, ako si napisat dany generator v
C-cku
 alebo v Jave?
 
  diik
  
 goro
  
 btw.: vstup je gif a text a vystup by mal byt bmp, ktory je
 kombinaciou
 oboch.
 
 nieco ine ako toto php by nebolo? :

/* Include the following function in your script: */

   function button($text) {
      $enc_text = urlencode($text);                      
      echo "<img src="button.php3?$enc_text" border=0 Alt="$text">";
  }


/* Then create a button.php3 which contains: */

<?
        Header("Content-type: image/gif");
        $string=implode($argv," ");
        $im = imagecreatefromgif("/button1.gif");
        $orange = ImageColorAllocate($im, 220, 210, 60);
        $px = (imagesx($im)-7.5*strlen($string))/2;
        ImageString($im,3,$px,9,$string,$orange);
        ImageGif($im);
        ImageDestroy($im);
?>

/*

button1.gif is a 135x40 GIF background for the button.  I use a dark
blue
background with bevelled edges and as the above example reflects,
orange
text.  Experiment with the colours and the sizing algorithm if you
change
the background image size.  You should also change the path to the
button1.gif image to reflect where you have your images within your
web
tree.

button1.gif is available at
http://www.sklar.com/px/files/graphics/button1.gif

*/

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQEVAwUBPTZ0GiFlwfHojdsMAQGFyQgAqJ4SfCF6q8A5hKDkQyRd78x4h3CDP6En
q4CdUaaqvTFS8KJJJDT5r3tFMgOW9DdGRFkEb+vPvxbKe4Z3904luESvJuxCfOVx
Q/ztl4xspOLC2YpXTyEVhRz3hzp5v/wrKWgWBQJV9E9Ha/ogA8rFswRJOXHSCGLp
s39Z3iP/Cx0EtKg9ZTqQr+b35jXQ8p/IPpdJbenzeXeFkHbTyBMIfSEYgCW3yFyv
PqfwdanzjEkj2qqXFSOI8Ylqh6qSamaLGcLrtMVfQqzhBfoyv0kitIU2kZKdYAzR
d4nHGPrSkvLVxcTlglOcjWFBczxQgim8njNAPFSFDmnQKbB9WsXR0w==
=8rDK
-----END PGP SIGNATURE-----


Další informace o konferenci Linux