GD and Image 함수 목록
PHP Manual

imagewbmp

(PHP 4 >= 4.0.1, PHP 5, PHP 7)

imagewbmp브라우저나 파일로 출력 이미지

설명

bool imagewbmp ( resource $image [, mixed $to [, int $foreground ]] )

imagewbmp() outputs or save a WBMP version of the given image.

인수

image

imagecreatetruecolor() 등의 이미지 생성 함수에서 반환한 이미지 자원.

to

저장할 파일 경로. 지정하지 않거나 NULL일 경우에는, raw 이미지 스트림을 직접 출력합니다.

foreground

You can set the foreground color with this parameter by setting an identifier obtained from imagecolorallocate(). The default foreground color is black.

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

변경점

버전 설명
5.4.0 Added support for passing a stream resource to to.

예제

Example #1 Outputting a WBMP image

<?php
// Create a blank image and add some text
$im imagecreatetruecolor(12020);
$text_color imagecolorallocate($im2331491);
imagestring($im155,  'A Simple Text String'$text_color);

// Set the content type header - in this case image/vnd.wap.wbmp
// Hint: see image_type_to_mime_type() for content-types
header('Content-Type: image/vnd.wap.wbmp');

// Output the image
imagewbmp($im);

// Free up memory
imagedestroy($im);
?>

Example #2 Saving the WBMP image

<?php
// Create a blank image and add some text
$im imagecreatetruecolor(12020);
$text_color imagecolorallocate($im2331491);
imagestring($im155,  'A Simple Text String'$text_color);

// Save the image
imagewbmp($im'simpletext.wbmp');

// Free up memory
imagedestroy($im);
?>

Example #3 Outputting the image with a different foreground

<?php
// Create a blank image and add some text
$im imagecreatetruecolor(12020);
$text_color imagecolorallocate($im2331491);
imagestring($im155,  'A Simple Text String'$text_color);

// Set the content type header - in this case image/vnd.wap.wbmp
// Hint: see image_type_to_mime_type() for content-types
header('Content-Type: image/vnd.wap.wbmp');

// Set a replacement foreground color
$foreground_color imagecolorallocate($im25500);

imagewbmp($imNULL$foreground_color);

// Free up memory
imagedestroy($im);
?>

참고


GD and Image 함수 목록
PHP Manual