开发者

PHP image creation functions question [closed]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜