Home  >  Article  >  Backend Development  >  php writes text in specified font on image

php writes text in specified font on image

WBOY
WBOYOriginal
2016-07-25 08:42:141075browse
  1. header('Content-type: image/gif');
  2. $image = imagecreate( 400, 200 );
  3. $red = imagecolorallocate($image, 255,0,0);
  4. $blue = imagecolorallocate($image, 0,0,255 );
  5. $font = 'ARIALBD.TTF';
  6. imageTTFtext( $image, 50, 0, 20, 100, $blue, $font, 'outofmemory.cn' );
  7. imagegif($image);
  8. ?>
复制代码
上写, php


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP remove BOM headerNext article:PHP remove BOM header