精緻化搬家團隊,提供住家、鋼琴搬運及倉儲保管服務 履約保障,搬家真的好放心 | 提供您優質的服務,主動尋找工程案件,30秒立即快速接案 業績提升10%~40%,每天多接2~3個客戶 |
用 php 的 gd 函式轉 bdf 成 jpeg |
房東:軍師 發表時間:2007-03-25 |
function bin_to_jpeg($bin) { $size = 64; // create the image $gif = ImageCreate($size,$size); $bg = ImageColorAllocate($gif,255,255,255); $tx = ImageColorAllocate($gif,0,0,0); ImageFilledRectangle($gif,0,0,$size,$size,$bg); //ImageString($gif,3,10,10,"it works ! 沈",$tx); $x=0; $y=0; for($i=0; $i imagesetpixel($gif, $x, $y, $tx); if($bin[$i] == "\n") { $x = 0; $y ++; } else { $x ++; } } // send the image header("content-type: image/jpeg"); ImageJPEG($gif); ImageDestroy($gif); } function cccii_to_jpeg($code) { $bin = cccii_to_bin($code); return bin_to_jpeg($bin); } function cccii_to_ascii($code) { $bin = cccii_to_bin($code); return bin_to_ascii($bin); } function bin_to_ascii($bin) { $bin = str_replace("0", " ", $bin); $bin = str_replace("1", "*", $bin); return $bin; } function bdf_to_file($code) { $fp = fopen("bdf/cccii64.bdf", "r"); if(!$fp) return; while($buf = fgets($fp, 2048)) { if(strstr($buf, "STARTCHAR $code")) { fgets($fp, 2048); fgets($fp, 2048); fgets($fp, 2048); fgets($fp, 2048); fgets($fp, 2048); for($i=0; $i<64; $i++) { $buf = fgets($fp, 2048); for($j=0; $j } $bin .= "\n"; } $fp = fopen("cccii/$code", "w"); fputs($fp, $bin); fclose($fp); break; } } } function cccii_to_bin($code) { if(!$code) return; if(!is_file("cccii/$code")) bdf_to_file($code); if(is_file("cccii/$code")) { $fp = fopen("cccii/$code", "r"); while($buf = fgets($fp, 1024)) $bin .= $buf; fclose($fp); return $bin; } } ?> |
|
廣利不動產-新板特區指名度最高、值得您信賴的好房仲 您的托付,廣利用心為您服務 廣利不動產-板橋在地生根最實在--新板特區指名度最高、值得您信賴的好房仲 完整房訊,房屋、店面熱門精選物件,廣利不動產 優質仲介,房屋租賃、買賣資訊透明,交易真安心! |
姓名: | |||
佈告內容: | |||
其他選項: | |||
|