update : 2015.11.03
php.shukuma.com

검색:
 
 
파일이나 URL에서 새 이미지를 생성

imagecreatefromwbmp

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

imagecreatefromwbmp파일이나 URL에서 새 이미지를 생성

설명

resource imagecreatefromwbmp ( string $filename )

imagecreatefromwbmp() returns an image identifier representing the image obtained from the given filename.

Tip

fopen 래퍼를 활성화하면, 파일명으로 URL을 사용할 수 있습니다. 파일 이름을 지정하는 방법은 fopen()을 참고하십시오. 다양한 래퍼의 기능, 사용법, 제공하는 예약 정의 변수들에 대해서는 Supported Protocols and Wrappers를 참고하십시오.

인수

filename

Path to the WBMP image.

반환값

성공 시에 이미지 자원 지시자를, 오류 시에 FALSE를 반환합니다.

예제

Example #1 Example to handle an error during loading of a WBMP

<?php
function LoadWBMP($imgname)
{
    
/* Attempt to open */
    
$im = @imagecreatefromwbmp($imgname);

    
/* See if it failed */
    
if(!$im)
    {
        
/* Create a blank image */
        
$im  imagecreatetruecolor(15030);
        
$bgc imagecolorallocate($im255255255);
        
$tc  imagecolorallocate($im000);

        
imagefilledrectangle($im0015030$bgc);

        
/* Output an error message */
        
imagestring($im155'Error loading ' $imgname$tc);
    }

    return 
$im;
}

header('Content-Type: image/vnd.wap.wbmp');

$img LoadWBMP('bogus.image');

imagewbmp($img);
imagedestroy($img);
?>

주의

Note: WBMP 지원은 PHP를 GD-1.8 이상에서 컴파일해야 합니다.