|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-11-19 10:29 UTC] luke at centre dot net dot au
For some reason I hanent been able to get imageTTFtext to work with ImageCreateTrueColor. It works fine with ImageCreate but not with the true color. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 16:00:01 2025 UTC |
<?php $fontsize=11; $angle=0; $fontfile="./pub/fonts/ARIAL.TTF"; $image = ImageCreateTrueColor(300, 16); $first=@imagecreatefromPNG("./pub/menuimg/$im1.png"); $white = imageColorAllocate($image, 255, 255, 255); $black = imageColorAllocate($image, 0, 0, 0); imageCopyResized($image,$first,1,0,0,0,ImageSX($first),ImageSY($first),ImageSX($first),ImageSY($first)); imagettftext($image, $fontsize, $angle, 23, 11, $black, $fontfile, "Main Page"); Header( "Content-type: image/png"); imagePNG($image); ImageDestroy ($image); ?>