开发者

PHP image creation functions question [closed]

开发者 https://www.devze.com 2023-02-17 21:05 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

Ca开发者_JS百科n someone list all the image creation functions for php?


look at http://us2.php.net/manual/en/refs.utilspec.image.php


Code to create a 200*200 square :

<?php
create_image();
print "<img src=image.png?".date("U").">";

function  create_image(){
        $im = @imagecreate(200, 200) or die("Cannot Initialize new GD image stream");
        $background_color = imagecolorallocate($im, 255, 255, 0);  // yellow
        imagepng($im,"image.png");
        imagedestroy($im);
}
?>

Drawing lines:

<?php
create_image();
print "<img src=image.png?".date("U").">";

function  create_image(){
        $im = @imagecreate(200, 200) or die("Cannot Initialize new GD image stream");
        $background_color = imagecolorallocate($im, 255, 255, 0);   // yellow

        $red = imagecolorallocate($im, 255, 0, 0);                  // red
        $blue = imagecolorallocate($im, 0, 0, 255);                 // blue
        imageline ($im,   5,  5, 195, 5, $red);
        imageline ($im,   5,  5, 195, 195, $blue); 

        imagepng($im,"image.png");
        imagedestroy($im);
}
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消