How to create blank image and set background color in php

How to create blank image and set background color in php

i.using the function ImageCreate(),we can able to create a blank
image.there are two arguments in imagecreate function.First one is the width of the image and second one is the height of the image.

sample code: ImageCreate(int width,int height);

ii.using the function ImageColorAllocate (), we can set the background color of the blank image.there are four arguments in
ImageColorAllocate function.First one is the values return from the
ImageCreate() function and remaining three arguments are the values of RGB color.

sample code:
$imgcrt = ImageCreate(150,150);
$imgclr = ImageColorAllocate($imgcrt,255,255,0);

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.