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);
-
-
-
- ImageString($im, 10, 100, 120, 'Hello,PHP', $white);
-
- Header ('Content-type: image/png');
-
- ImagePng($im);
-
- ImageDestroy($im);
-
- ?>
|