다음 shoutcast 상태 출력을 GD를 사용하여 이미지에 쓰려고하는데 작동하지 않습니다. 내가 도대체 뭘 잘못하고있는 겁니까?(shoutcast 상태) 스크립트의 출력을 이미지에 작성하십시오.
$string = "/home/test.txt";
위 내용을 사용하면 파일 내용이 아닌 파일의 경로 만 표시됩니다.
출력 :
psytrance.value 37
breaks.value 8
dubstep.value 6
reggae.value 130
oldskool.value 5
ambient.value 81
test.value <- this should be ignored!
complete.value 267
PHP는 다음 SHOUTcast에 상태가 test.txt
에 저장됩니다
<?php
header ("Content-type: image/png");
$string = "/home/test.txt";
// try changing this as well
$font = 4;
$width = imagefontwidth($font) * strlen($string) ;
$height = imagefontheight($font) ;
$im = imagecreatefrompng("/home/banner2.png");
$x = imagesx($im) - $width ;
$y = imagesy($im) - $height;
$backgroundColor = imagecolorallocate ($im, 255, 255, 255);
$textColor = imagecolorallocate ($im, 0, 0,0);
imagestring ($im, $font, $x, $y, $string, $textColor);
imagepng($im);
?>
shoutcast 상태를 유지할 수 있다면 이미 답을 알고있는 것처럼 보입니다. – LSerni
위에 질문을 업데이트했습니다 ... –
아, 알겠습니다. 미안하지만, 알아 냈어야했는데 .. 음, @ take의 답을 받아 들일 수 있습니다 ;-) – LSerni