图形函数库

ImageCreate

(PHP3 , PHP4)

ImageCreate ---  建立一个新的图形

语法 : int imagecreate (int x_size, int y_size)

说明 : 

ImageCreate( )传回一个图形的identifier,表示大小为 x_size、y_size的一个空白的图形。

Example :

<?php

    header ("Content-type: image/png"); 

    $im = @ImageCreate (50, 100) or die ("Cannot Initialize new GD image stream"); 

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

    $text_color = ImageColorAllocate ($im, 233, 14, 91); 

    ImageString ($im, 1, 5, 5, "A Simple Text String", $text_color); 

    ImagePng ($im);

?>


上一页 首页 下一页