"Fossies" - the Fresh Open Source Software Archive

Member "fly-2.0.1/doc/examples.html" (17 Jun 2009, 4425 Bytes) of package /linux/www/old/fly-2.0.1.tar.gz:

Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the fly-2.0.1.tar.gz project site itself.

fly: examples

If you are using fly from within a CGI program, here are some examples:


If you use perl, you should really use Lincoln Stein's GD.pm.



$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";
# test out fly!

cat > /tmp/fly.$$ <<EOD
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

fly -i /tmp/fly.$$ -o test.jpeg
Fly Scripts

You can even create your own fly "scripts"!

#!/usr/local/bin/fly -q
size 256,256
type gif
fill 1,1,255,255,255

Thanks to Andrew Finkenstadt <andyf@simutronics.com> for noting this unintentional feature of fly.

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.

[Valid XHTML 1.0!]