0

これが私のサイトです。今のところ、独自のテストURLを作成しようとしています。

http://boats.instantonlinesuccess.co.uk/boat-names.html

それを見ると、私がやろうとしていることがわかります。JavaScriptをPHPにリンクしようとしているので、書き込みはエフェクト/エフェクトカラー/カラーで表示されます。それはすべて、私が書き込もうとしているPHPスクリプトを介して生成されます。

これが私のPHPです:

<?php header("Content-type: image/png");
    $string = $_GET['text'];
    $currentFont =$_GET['font'];
    $currentTextColour = $_GET['colour'];
    $currentEffect = $_GET['effect'];
    $currentEffectColour = $_GET['effectcolour'];
    $im = imagecreatefrompng("images/test.png");
    $px = (imagesx($im) - 7.5 * strlen($string)) / 2;
    //if you exactly know the RGB color indexes//
    $rgb = imagecolorexact($im, 0, 0, 0);
    //or keep the rgb color by position so at top 0 left 0 
    $rgb = imagecolorat($im, 0, 0);
    imagecolortransparent($im, $rgb);
    imagestring($im, 64, $px, 16, $string, $currentTextColour);
    imagepng($im); imagedestroy($im); 
?>

JavaScriptが必要な場合は、お知らせください。

4

1 に答える 1

0

最初の行をこれに変更して、問題をデバッグしてみてください。

header('Content-Type: text/plain');

于 2012-04-25T21:15:42.820 に答える