我在程序中调用imagecolortransparent( $iImage, $iWhite );
imagefill( $iImage, 0, 0, $iWhite );等函数就会终止。但是可以调用@imagecreatetruecolor( $iImageX, $iImageY )
            or die( PMT_CREATE_IMAGE_FAILED );是成功的。用phpinfo看php的情况,gd已经支持。现在不知道是什么原因导致这个问题的出现,请大侠们给小弟一些指点!不胜感激!!!!

解决方案 »

  1.   

    看看你的 $iWhite 是不是正常的。
      

  2.   

    $iImageX = 2200 + 10; //每一个柱的宽度为100像素
    $iImageY = 620; //其中有10像素是用来写标题的
    $iStep = ceil( 10000 / 600 );//一个像素代表的金额值
    $iImage = @imagecreatetruecolor( $iImageX, $iImageY )
                or die( PMT_CREATE_IMAGE_FAILED );
    $iBlack = imagecolorallocate( $iImage, 0, 0, 0 );
    $iBlue = imagecolorallocate( $iImage, 0, 0, 255 );
    $iYello = imagecolorallocate( $iImage, 255, 255, 0 );
    $iWhite = imagecolorallocate( $iImage, 255, 255, 255 );
    $iTrans = imagecolortransparent( $iImage, $iWhite );
    imagefill( $iImage, 0, 0, $iWhite );当执行到imagecolortransparent的时候就执行不下去了。同样imagefill也不能正常执行
      

  3.   

    用phpinfo看到的Configure command:
    './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd=shared' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses=shared' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mime-magic=/usr/share/file/magic.mime' '--with-apxs2=/usr/sbin/apxs' 
    gd信息如下:
    GD Support          enabled  
    GD Version          bundled (2.0.28 compatible)  
    FreeType Support    enabled  
    FreeType Linkage    with freetype  
    GIF Read Support    enabled  
    GIF Create Support  enabled  
    JPG Support         enabled  
    PNG Support         enabled  
    WBMP Support        enabled  
    XBM Support         enabled  
      

  4.   

    $iImage = @imagecreatetruecolor( $iImageX, $iImageY )
                or die( PMT_CREATE_IMAGE_FAILED );
    把@去掉,会出现什么东西?