Re: [PROPOSAL] Package 'ImageText'
| From: | Joshua Eichorn | Date: | Thu, 09 Oct 2003 16:00:18 +0000 |
| Subject: | Re: [PROPOSAL] Package 'ImageText' | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22526@lists.php.net to get a copy of this message | ||
Bertrand Mansion wrote:
<jeichorn@joshuaeichorn.com> wrote :A method to handle the function calls below: | $img = imagecreate('500', '200'); $white = imagecolorallocate($img, 255, 255, 255); $black = imagecolorallocate($img, 0, 0, 0);Tobias Schlitt wrote:Sorry, what do you mean with that?Am Thursday, October 09, 2003 1:32 AM [GMT+0100=CET], artikulierte Joshua Eichorn <jeichorn@joshuaeichorn.com>:I like the output looks like a good start. There are a coupel things i would like addedSome helper methods so you didn't have to use the gd methods directly unless you needed the extra power.
imagefill($img, 0, 0, $white);imagerectangle($img, 0, 0, 499, 199, $black); imagerectangle($img, 45, 95, 355, 155, $black); $test->toImage($img, 50, 100); //var_dump($test); header("Content-type: image/png"); imagepng($img); imagedestroy($img); ||Just so in the basic case where you wanted to create an image with some text you could do $test->setBackgroud(||255, 255, 255);| |$test->imageDisplay(); And that would do the imagepng, imagedestory calls etc as well as setting the header. Maybe it would be better just to show an example of using this with another class that handled creating images but i don't know if one exists, i know its never a good idea to put unrelated functionality in a class but it would be nice to be able to create the image with just the api from the class. IMO, that's not the purpose of this class and therefore, I would be against your suggestions. Bertrand Mansion Mamasam Is there a class that does this in PEAR that this class could be integrated with, its seems very odd to have a nice OO class and then have to look up a bunch of GD functions to use it. -josh