php创建图片教程,我们在编程时经常会看到用php写图片,验证码等,下面是一个简单的php创建图片实例代码:
- <?php
- $height = 300;
- $width = 300;
- $im = ImageCreateTrueColor($width, $height);
- $white = ImageColorAllocate ($im, 255, 255, 255);
- $blue = ImageColorAllocate ($im, 0, 0, 64);
- ImageFill($im, 0, 0, $blue);
- //ImageLine($im, 0, 0, $width, $height, $white);
- ImageString($im, 10, 100, 120, 'Hello,PHP', $white);
- Header ('Content-type: image/png');
- ImagePng($im);
- //开源代码Vevb.com
- ImageDestroy($im);
- ?>
新闻热点
疑难解答