圖形函式庫

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);

?>


上一頁 首頁 下一頁