English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP image2Usage and examples of wbmp() function

Traitement des images PHP

image2wbmp — Outputs images in WBMP format to the browser or file.

Syntax

int image2wbmp ( resource $image[, string $filename[, int $threshold ]])

image2wbmp() creates a WBMP file named filename from an image. The image parameter is the return value of a created image function, such as imagecreatetruecolor().

The filename parameter is optional. If omitted, the original image stream is output directly.

Example

<?php
$file = 'php.jpg';
$image = imagecreatefrompng($file);
header('Content-type: ' . image_type_to_mime(IMAGETYPE_WBMP));
image2wbmp($file); // Directly output the original image stream
?>

Traitement des images PHP