Jump to content

cohs

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cohs's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. can someone help me and tell me why this only outputs a black rectangle. <?php header("Content-type: image/jpg"); $a = imagecreatefromjpeg("c:\C.jpg"); $x = imagesx($a) ; $y = imagesy($a); $new = imagecreatetruecolor($x,$y); imagepalettecopy($new,$a); for ($count2 =1; $count2 >=$y;$count2++){ for ($count = 1;$count >= $x;$count++){ $pixel = imagecolorat($a,$count,$count2); $pix = imagecolorsforindex($a,$pixel); $color = imagecolorallocate($a,$pix['red'],$pix['green'],$pix['blue']); imagesetpixel($new,$count,$count2, $color); } } imagejpeg($new);?> i know its messy but i was moving things around trying to figure it out. thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.