[PHP-users 8462] Re: GD のImageTTFTextが動きません

Hideyuki Shimooka php-users@php.gr.jp
Sat, 6 Jul 2002 10:04:48 +0900


下岡です。

---- Suzuki Takamasaさん曰く...

>下記のようなPHPスクリプトを書きました。
>$jpeg = "sample.jpg";
>$image = imagecreatefromjpeg($jpeg);
>$black = imagecolorallocate($image, 0,0,0);
>imagestring ($image, 5, 10, 10, "Test", $black);
>imagestringup ($image, 5, 50, 100, "Test2", $black);
>ImageTTFText ($im, 20, 0, 10, 20, $white, "/usr/share/fonts/ja/TrueType/kochi-mincho.ttf","今日は");
>header("Content-type: image/jpeg");
>imagejpeg($image);
>
>でこのwebページを見ると下記のようなエラーメッセージが出ました。
>Warning: Supplied argument is not a valid Image resource in /usr/local/apache/htdocs/sample_image.php on line 9

ImageTTFText ($im, 20, 0, 10, 20, $white, "/usr/share/fonts/ja/TrueType/kochi-mincho.ttf","今日は");
              ~~~
$imageでは?

-- 
0---+----1----+----2----+----3----+----4----+----5----+----6
Hideyuki Shimooka / shimooka@axissoft.co.jp
Web Solution Group, AXIS Software Co.,Ltd.
Phone 03-5950-3525  Fax 03-5950-3524