|
Posted by comp.lang.php on 04/16/07 10:58
On Apr 16, 7:23 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Steve wrote:
> > "comp.lang.php" <phillip.s.pow...@gmail.com> wrote in message
> >news:1176703238.175491.180780@y80g2000hsf.googlegroups.com...
> > | On Apr 16, 1:41 am, "Steve" <no....@example.com> wrote:
> > | > hey genious, here's an RBI:
> > | >
> > | > foreach (
> > | > array(
> > | > $section ,
> > | > 'newImage' ,
> > | > "${section}_width" ,
> > | > "${section}_height"
> > | > )
> > | > as $val
> > | > ){ $this->$val =& ${$val}; }
> > | >
> > | > what do you intend to do with this lil' gem, eh? you do realize you'll
> > get
> > | > the same results by just:
> > | >
> > | > $this->val =& "${section}_height";
> > | >
> > | > ahhh, so when you plagerized the functionality, you copied it
> > | > incorrectly...i see.
> > | >
> > | > ROFLMFAO !!!
> > |
> > | It's "genius", BTW.
>
> > coming around the home stretch...ahhh, slides right in for another. that's 2
> > for home, visitors...zilch.
>
> > you'se awr a brittun.
>
> > entendre^2...perhaps you've heard of it?
>
> Sorry, Steve. I agree with comp.lang.php. You added absolutely nothing
> to this conversation except taking up bandwidth. And it's my bandwidth,
> also.
>
> I'm glad he got this fixed in spite of your immature language and attitude.
Thank you, Jerry, very nice to hear this! Unfortunately no I never
did solve the problem; I am still not capable of grayscaling an image:
/**
* Make the image grayscale
*
* @access protected
*/
function makeGray() { // VOID METHOD
global $section;
for ($i = 0; $i <= 255; $i++) $colorNDX[$i] =
@imagecolorallocate($this->$section, $i, $i, $i);
for ($y = 0; $y < $this->{$section . '_height'}; $y++) {
for ($x = 0; $x < $this->{$section . '_width'}; $x++) {
$ndx = @imagecolorat($this->$section, $x, $y);
$red = ($ndx >> 16) & 0xFF;
$green = ($ndx >> 8) & 0xFF;
$blue = $ndx & 0xFF;
//$ndxColorArray = @imagecolorsforindex($this->$section, $ndx);
//$avg = floor(($ndxColorArray['red'] + $ndxColorArray['green'] +
$ndxColorArray['blue']) / 3);
$col = $red * 0.299 + $green * 0.587 + $blue * 0.114;
@imagesetpixel($this->$section, $x, $y, $colorNDX[$col]);
}
}
//@imagecopy($this->newImage, $this->$section, 0, 0, 0, 0,
// $this->{$section . '_width'}, $this->{$section .
'_height'});
}
No image is ever produced in spite of the code produced.
>
> For your next post try alt.anal.orifices. It matches you perfectly.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================
Navigation:
[Reply to this message]
|