1、imagestring使用的是点阵字库,用ImageLoadFont()加载自定义的字库
2、imagecolorallocate用来匹配图形的颜色,供其它绘图函式使用而非创建图像
设定透明色用ImageColorTransparent
3、你需要自行定义“过滤器”函数
4、截屏。没有

解决方案 »

  1.   

    <?
    header ("Content-type: image/png");
    $im = @imagecreate (800, 600)
    $background_color = imagecolorallocate ($im, 255, 255, 255);
    ImageColorTransparent($im, 255, 255, 255);//透明色㈠
    $text_color = imagecolorallocate ($im, 33, 214, 91);
    $font=ImageLoadFont("1.c");//设置字体㈡
    imagestring ($im, $font, 100, 115,  "www.kingshang.com", $text_color);//显示文字㈢
    $im2 = imageCreatefrompng("2.png");
    imagecopy($im2, $im, 155, 155, 100, 100, 400, 200);
    imagepng ($im2);
    imagedestroy ($im2);㈠透明失败
    ㈡字体没有被引用
    ㈢文字不能用中文,也不能修改大小——这个应该是需要中文字库,需要在哪里设置?另外,定义过滤器是何意?
      

  2.   

    imagestring使用的是点阵字库,不能直接支持中文
      

  3.   

    ImageColorTransparent($im, $background_color);//透明色㈠
      

  4.   

    注意:
    ImageColorTransparent 函数 对 imagecreatetruecolor 创建的图形 无效
      

  5.   

    <?php
    //header ("Content-type: image/png");
    $im = @imagecreate (80, 60);
    $background_color = imagecolorallocate ($im, 255, 255, 255);
    ImageColorTransparent($im, $background_color);// 这样设置透明色
    $text_color = imagecolorallocate ($im, 33, 214, 91 );
    //$font=ImageLoadFont("1.c");//设置字定义字体见ImageLoadFont说明
    $font = 5;
    imagestring ($im, $font, 1, 1,  "www.kingshang.com", $text_color);$im2 = imageCreatefromgif("images/csdn.gif");
    imagecopy($im2, $im, 20, 40, 1, 1, 80, 60);
    imagepng ($im2);
    imagedestroy ($im2);?>
      

  6.   

    $font = 10;imagestring ($im, $font, 1, 1,  "www.kingshang.com", $text_color);