fly: 解説: 使用例  [fly]

使用例

flyを実行するサンプルをいくつか紹介します:

Perl

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);
csh
#!/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 スクリプト

flyだけでスクリプトを作ることもできます!

#!/usr/local/bin/fly -q
new
size 256,256
fill 1,1,255,255,255
<etc>

考えてもみなかった、この使い方を知らせてくれた Andrew Finkenstadt 氏 <andyf@simutronics.com> に感謝します。

C
C言語を利用されるなら、じかに gd を呼び出してください!!

ここに紹介したサンプルで、どんな絵が描かれるか、わかりますか?
実行結果は これです!

[New!] flyの実行結果を、すばやく、手軽に確かめられるように、 flyテスター という CGIを用意しました。ご利用ください。 このスクリプトは、flyの配布アーカイブにも含まれています。


[トップページ] [解説] [著作権] [御意見・御感想]


作成日 : 1995年6月21日
最終更新日 : 1999年10月7日
アクセス : Unrestricted.
Copyright © 1994-1999 Martin Gleeson and The University of Melbourne.
<URL:http://www.unimelb.edu.au/fly/>
Martin Gleeson, gleeson@unimelb.edu.au

日本語版作成 : 1999年10月21日 by p4room