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

PHP Image Processing

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

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 function that creates an image, such as imagecreatetruecolor().

The filename parameter is optional. If omitted, the original image stream will be 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
?>

PHP Image Processing