PHP: imagegif 您所在的位置:网站首页 image/rotate/rightc.gif PHP: imagegif

PHP: imagegif

2022-11-16 05:46| 来源: 网络整理| 查看: 265

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): bool

imagegif() 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.

Parameters

image

A GdImage object, returned by one of the image creation functions, such as imagecreatetruecolor().

file

The 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 Values

Returns true on success or false on failure.

Caution

However, 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 实验室设备网 版权所有