Re: GD graphics library

[email protected] (Matthew Somerville) Thu, 28 Jun 2001 10:55:26 +0100
Newsgroups perl.riscos
Message-ID <4A91A50BD9%[email protected]>
In message <[email protected]>
          James Taylor <[email protected]> wrote:

> If there's any chance of getting GD to work on RISC OS, and therefore for
> me to be able not only to practise using GD from Perl, but also to write
> useful little graphics utilities on RISC OS, then I'd be very interested. I
> can't be the only RISC OS Perl programmer that would find GD on RISC OS an
> exciting prospect.

I'm not sure if this has already been said, and apologies if it has, but PHP
for RISC OS (available from <http://www.ecs.soton.ac.uk/~ajw498/> along with
a StrongHelp manual of the online manual available at
<http://www.php.net/manual/> and a webserver WebJames that handles Perl and
PHP) has GD support built in, is similar to Perl in many ways, and can be
used as simply as follows:

<?php
header("Content-Type: image/gif");
$im = @ImageCreate(100,100) or die ("Cannot initialize new GD image");
$background = ImageColorAllocate($im,255,255,255);
$colour = ImageColorAllocate($im,255,0,0);
ImageFilledRectangle($im,25,25,75,75,$colour);
ImageGIF($im);
?>

I don't see why GD support couldn't be compiled in with Perl from source, but
then you have to decide do you want GD pre 1.6 which outputs GIFs (as RISC OS
PHP currently uses) or post 1.6 which outputs PNGs?

ATB,
Matthew
-- 
"You, slave, will be torn apart by horses, to the plaudits of the troops
 and the amusement of the children."
              - Gloriosus, A Funny Thing Happened on the Way to the Forum

http://www.dracos.co.uk/