0

キャプチャ画像の作成にはPHPを使用しています。読み込み時のキャプチャを表示しています。読み込みが完了した後、Chrome でキャプチャ イメージが表示されません。他のブラウザでは問題なく動作しています。なんで?

<?php
// Create an image from button.png
$image = imagecreatefrompng('button.png');

// Set the font colour
$colour = imagecolorallocate($image, 255, 120, 4);

// Set the font
$font = '../fonts/Anorexia.ttf';

// Set a random integer for the rotation between -15 and 15 degrees
$rotate = rand(-15, 15);

// Create an image using our original image and adding the detail
imagettftext($image, 18, $rotate, 18, 30, $colour, $font, $str);

// Output the image as a png
imagepng($image);

?>
4

2 に答える 2

2

同じ問題があります..考えられる理由の1つは、アンチバナー/アンチウイルスです..私はKarperskyを使用しています..Kaspersky Captchaをオフにすると、Chromeからは少し奇妙に表示されます..この問題を探す必要があると思います

于 2012-10-30T06:28:50.407 に答える
1

あなたのコード全体は正しいです

header('Content-Type: image/png');

あなたのコードの上に...

于 2012-10-30T11:16:24.600 に答える