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);
- ?>
新聞熱點
疑難解答