fly: examples
If you are using fly from within a CGI program, here are some examples:
- Perl
If you use perl, you should really use Lincoln Stein's
GD.pm.
Nevertheless...
#!/usr/local/bin/perl
$flyprog = "/usr/local/bin/fly";
$outfile = "temp.png";
open(FLY,"| $flyprog -o $outfile ");
print FLY "new\n";
print FLY "size 256,256\n";
print FLY "type png\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
type jpeg
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.jpeg
- Fly Scripts
You can even create your own fly "scripts"!
#!/usr/local/bin/fly -q
new
size 256,256
type gif
fill 1,1,255,255,255
<etc>
Thanks to Andrew Finkenstadt <andyf@simutronics.com> for noting
this unintentional feature of fly.
- C
- If you're using C, then you might as well use gd!!
Can you guess what the above examples produce?
Here's the answer!
I have created a Fly Tester CGI program that lets you test fly
commands quickly in a convenient interface. The program is in the
examples directory in the fly distribution.
|
|