ntcolor = imagecolorallocate($im, 0, 0, 0); $top_rectangle_color = imagecolorallocate($im,241,254,237); $top_letter_color = imagecolorallocate($im,54,126,76); $left_rectangle_color = imagecolorallocate($im,243,247,255); $left_num_color = imagecolorallocate($im,4,68,192); $logo_str_color = imagecolorallocate($im,0,0,0); imagefill($im,0,0,imagecolorallocate($im,255,255,255)); //图片背景色 $font = ''./public/baomi/fonts/simsun.ttc''; //字体 $font_en = ''./public/baomi/fonts/CONSOLA.TTF''; //英文字体 $font2 = ''./public/baomi/fonts/simhei.ttf''; //密保卡上方黑体 $dst = imagecreatefromjpeg("./public/baomi/120.jpg"); imagecopymerge($im,$dst,120,15,0,0,193,55,100); imageline($im,10,72,$width-10,72,$linecolor); $ltext = "电子密保卡"; if(!imagettftext($im,10,0,340,47,$logo_str_color,$font2,$ltext)) { exit(''error''); } //写入卡号 $b = ''1000'' . $info[''card_num'']; for($i=0;$i<7;$i++){ $p.= substr($b,3*$i,4). '' ''; } $x = 40; $y = 95; //序列号位置 imagettftext($im,10,0,$x,$y,$color,$font,''序列号''); imagettftext($im,11,0,$x+50,$y,$color,$font_en,$p); //颜色框 imagefilledrectangle |