PHP: imagegif | 您所在的位置:网站首页 › image/rotate/rightc.gif › PHP: imagegif |
imagegif
(PHP 4, PHP 5, PHP 7, PHP 8) imagegif — Output image to browser or file Description imagegif(GdImage $image, resource|string|null $file = null): boolimagegif() creates the GIF file in file from the image image. The image argument is the return from the imagecreate() or imagecreatefrom* function. The image format will be GIF87a unless the image has been made transparent with imagecolortransparent(), in which case the image format will be GIF89a. Parametersimage A GdImage object, returned by one of the image creation functions, such as imagecreatetruecolor(). fileThe path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or null, the raw image stream will be output directly. Return ValuesReturns true on success or false on failure. CautionHowever, if libgd fails to output the image, this function returns true. Changelog Version Description 8.0.0 image expects a GdImage instance now; previously, a resource was expected. Examples
Example #1 Outputting an image using imagegif() Example #2 Converting a PNG image to GIF using imagegif() |
CopyRight 2018-2019 实验室设备网 版权所有 |