imagecreatefromxpm
(PHP 4 >= 4.0.1, PHP 5)
imagecreatefromxpm — Create a new image from file or URL
설명
resource imagecreatefromxpm
( string $filename
)
imagecreatefromxpm() returns an image identifier representing the image obtained from the given filename.
Tip
fopen 래퍼를 활성화하면, 파일명으로 URL을 사용할 수 있습니다. 파일 이름을 지정하는 방법은 fopen()을 참고하십시오. 다양한 래퍼의 기능, 사용법, 제공하는 예약 정의 변수들에 대해서는 Supported Protocols and Wrappers를 참고하십시오.
인수
- filename
-
Path to the XPM image.
반환값
Returns an image resource identifier on success, FALSE on errors.
예제
Example #1 Creating an image instance using imagecreatefromxpm()
<?php
// Check for XPM support
if(!(imagetypes() & IMG_XPM))
{
die('Support for xpm was not found!');
}
// Create the image instance
$xpm = imagecreatefromxpm('./example.xpm');
// Do image operations here
// PHP has no support for writing xpm images
// so in this case we save the image as a
// jpeg file with 100% quality
imagejpeg($xpm, './example.jpg', 100);
imagedestroy($xpm);
?>
반환값
Note: 이 함수는 PHP에 포함된 GD 라이브러리를 사용하여 컴파일하였을 경우에만 사용할 수 있습니다.
Note: 이 함수는 윈도우 플랫폼에서는 작동하지 않습니다.
There are no user contributed notes for this page.
