Manipute image with php -
I am trying to create a picture and fill my pixel randomly but I have the following problems: 1) I did not get any more information about using the GD library 2) I do not know how many bytes of the image that I created using 'imagecreatetruecolor ()'
How do I Leave a picture of the program works; Looking for to do with the map (photo) ...
Image here:
& lt ;? Php function num_random () {$ Desde = 0; $ Haste = 255; $ Num = Rand ($ desde, $ hasta); Return $ Num; } Header ("Content-Type: Image / PNG"); $ Width = 250; // ANO $ height = 250; // Alto $ im = @imagecreate ($ width, height $) or die ("Can not start new GD image stream"); $ Background_color = imagecolorallocate ($ im, 0, 0, 0); For ($ i = 0; $ i & lt; $ height; $ i ++) {// Rico Vertical For ($ j = 0; $ j & lt; $ width; $ j ++) {// Rico Lineal $ color = imagecolorallocate ($ im, num_random (), num_random (), num_random ()); Imagesetpixel ($ im, $ i, $ j, $ color); }} Imagepng ($ im); ? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? Php printf ("& lt; img src = '% s' & gt;", $ im) ;? & Gt; & Lt; / Body & gt; & Lt; / Html & gt;
Thank you for your mind :)
just create the image Change Imagecreatetruecolor
$ im = @imagecreate ($ width, height $) or die ("Can not start new GD image stream");
$ im = @imagecreatetruecolor ($ width, $ height) or die ("Can not start new GD image stream"); Results
Comments
Post a Comment