imagecreate imagecreate (PHP 3, PHP 4, PHP 5)
imagecreate -- Crea una nueva imagen con una paleta de colores
Descripción resource
imagecreate ( int x_size, int y_size )
imagecreate() devuelve un identificador de imagen representando
una imagen en blanco de tamaño x_size por y_size .
Se recomienda emplear la función imagecreatetruecolor() .
Ejemplo 1.
Crear un nuevo recurso de imagen con GD y mostrar la imagen
<?php header ( "Content-type: image/png" ); $im = @ imagecreate ( 100 , 50 ) 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 ); imagedestroy ( $im ); ?>
Vea también imagedestroy() y
imagecreatetruecolor() .