0

RSPS用のゲームカードを作ろうとしています。PHP を使用して画像にテキストを生成するのはこれが初めてで、この奇妙なグリッチを適用しようとすると、次のようになります。

ただし、元の写真が次のようになっている場合:

ご覧のとおり、コーナーは本来あるべきように湾曲していません。でも、原作ではちゃんと出てる。私は数字の位置について話しているのではありません。私が使用しているコードは次のとおりです。

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

// Image Creation
$image_file = "SoulSplitCard.png";
$im = imagecreatefrompng($image_file);

//Colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$rscol = imagecolorallocate($im, 23, 113, 183);


// Levels (for now)
$text = '99';
$text2 = '87';
// Font
$font = 'arial.ttf';

//Text Applications
imagettftext($im, 15, 0, 150, 35, $rscol, $font, $text);
imagettftext($im, 15, 0, 150, 81, $rscol, $font, $text2);

// Using imagepng() instead of imagejpeg()
imagepng($im);
imagedestroy($im);
?>

これが起こる原因は何ですか?

4

0 に答える 0