Re: gd function/parameters

From: Date: Sat, 29 Jul 2000 19:07:08 +0000
Subject: Re: gd function/parameters
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-26854@lists.php.net to get a copy of this message
> any of the drawing functions should be able to take gdBrushed or gdStyled > or gdStyledBrushed. the fill functions should be able to take gdTiled > after gdimagesettile() is called... in c, these work out to be special > defined colors, but I don't know the best way to do that in php (eg. > imageline($im,0,0,99,99,'gdBrushed')?) I was thinking of having setbrush > return gdBrushed, but that would seem to create the illusion of being able > to have multiple brushes. (same as styles... and then you couldn't pass > in gdStyledBrushed anyway) Well, why not add this functionality? Create a function that defines a brush. It might take a filename of a brush source file, or whatever other args might be relevant when it comes to creating a brush. Return a resource identifier for this brush, but don't actually create it. Just store the brush parameters in the resource struct. Then when this resource identifier is used in place of the colour argument in any of the various functions that understand brushes, create the brush by pulling the brush parameters from the resource struct (if it isn't the current brush). This will make it easy for people to work with multiple brushes the same way they work with multiple colours. -Rasmus

« previous php.dev (#26854) next »