Problems using GD 1.8 with PHP3.0.15

From: Date: Fri, 23 Jun 2000 09:15:15 +0000
Subject: Problems using GD 1.8 with PHP3.0.15
Groups: php.general 
Request: Send a blank email to php-general+get-2760@lists.php.net to get a copy of this message
Hello, I have serious Problems using the GD-Library it seems to be a problem with the integration of the gd-source in php or It´s just me banghead. The following source makes the problem <? header("content-type: image/png"); $websize=array("800","600"); /* should be the outputsize for the detail from PNG */
   $scale=1;/* 0.8 */                      /* If one uses 800x600 resoulution one should be able to scale the output */
   $malpunkt=array("244","277"); /* there should a dot be drawn on center=$malpunkt */
/* the PNG Source is a map size 2601x1192 pixel */ $im=ImageCreateFromPNG("../../pix/map/iser_2601_1192_V1.png"); /* now I tried to allocate the color as you see in the bottom I tried several ways */ $blue=ImageColorAllocate($im, 0x2c,0x6D,0xAF); /* this produces WHITE in the output */
    //$yellow =ImageColorClosest($im, 255,255,0);
     //$yellow=ImageColorResolve($im, 255,255,0);
      //echo "<html>CLOSEST=$yellow<br>";
/* all of the above make colors nearly to black or Thats the Problem randomly dark purple or dark grey, but NEVER yellow */
$im_out=ImageCreate($websize[0],$websize[1]); imageCopyResized($im_out,$im,0,0,800,160,$websize[0] * $scale,$websize[1] * $scale,$websize[0],$websize[1]); //ImageArc($im_out,$malpunkt[0],$malpunkt[1],10,10,0,360, $blue); /* Normally the script should paint a dot but the best failure comes when I draw a rectangle The aerea which is in the rectangle
      will be de-colored only fragments of the original painting will appear */
ImageRectangle($im_out,$malpunkt[0],$malpunkt[1],$malpunkt[0]+10,$malpunkt[1]+10,$blue); ImageFill($im_out,$malpunkt[0],$malpunkt[1],$yellow); ImagePng($im_out); ImageDestroy($im_out); ?> Maybe there´s someone out who could help me or knows someone who works with GD and PNG´s who I could ask. TIA Oliver Heinisch

« previous php.general (#2760) next »