您的位置:首页 > 编程语言 > PHP开发

php 简单创建图像

2008-11-24 12:02 309 查看
<?php

// set up image 

  $height = 200;

  $width = 200;

  $im = ImageCreateTrueColor($width, $height);

  $white = ImageColorAllocate ($im, 255, 255, 255);

  $blue = ImageColorAllocate ($im, 0, 0, 64);

// draw on image  

  ImageFill($im, 0, 0, $blue);

  ImageLine($im, 0, 0, $width, $height, $white);

  //ImageString($im, 4, 50, 150, 'Sales', $white);

// output image

  Header ('Content-type: image/png');

  ImagePng ($im);

  

// clean up 

  ImageDestroy($im);

?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  php im header