fly: 解説: 使用例 |
flyを実行するサンプルをいくつか紹介します:
perlから呼び出すなら(訳注:Perl5の場合)、本当は、fly ではなく Lincoln Stein 氏の GD.pm を利用するのがおすすめです。
まあ、それはそれとして……
#!/usr/local/bin/perl $flyprog = "/usr/local/bin/fly"; $outfile = "temp.gif"; open(FLY,"| $flyprog -o $outfile "); print FLY "new\n"; print FLY "size 256,256\n"; print FLY "fill 1,1,255,255,255\n"; print FLY "circle 128,128,180,0,0,0\n"; print FLY "fill 128,128,255,255,0\n"; print FLY "arc 128,128,120,120,0,180,0,0,0\n"; print FLY "circle 96,96,10,0,0,0\n"; print FLY "circle 160,96,10,0,0,0\n"; print FLY "fill 96,96,0,0,0\n"; print FLY "fill 160,96,0,0,0\n"; close(FLY);
#!/bin/csh # test out fly! cat > /tmp/fly.$$ <<EOD new size 256,256 fill 1,1,255,255,255 circle 128,128,180,0,0,0 fill 128,128,255,255,0 arc 128,128,120,120,0,180,0,0,0 circle 96,96,10,0,0,0 circle 160,96,10,0,0,0 fill 96,96,0,0,0 fill 160,96,0,0,0 EOD fly -i /tmp/fly.$$ -o test.gif
flyだけでスクリプトを作ることもできます!
#!/usr/local/bin/fly -q new size 256,256 fill 1,1,255,255,255 <etc>
考えてもみなかった、この使い方を知らせてくれた Andrew Finkenstadt 氏 <andyf@simutronics.com> に感謝します。
ここに紹介したサンプルで、どんな絵が描かれるか、わかりますか?
実行結果は これです!
flyの実行結果を、すばやく、手軽に確かめられるように、 flyテスター という CGIを用意しました。ご利用ください。 このスクリプトは、flyの配布アーカイブにも含まれています。
作成日 : | 1995年6月21日 |
最終更新日 : | 1999年10月7日 |
アクセス : | Unrestricted. |
Martin Gleeson, gleeson@unimelb.edu.au |
日本語版作成 : 1999年10月21日 by p4room