Документ взят из кэша поисковой машины. Адрес оригинального документа : http://old.hcs.cmc.msu.ru/php/function.imagecreatefromwbmp.html
Дата изменения: Sun Feb 3 22:41:24 2002
Дата индексирования: Mon Oct 1 23:02:02 2012
Кодировка:
ImageCreateFromWBMP

ImageCreateFromWBMP

(PHP 4 )

ImageCreateFromWBMP -- Create a new image from file or URL

Description

int imagecreatefromwbmp ( string filename)

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

ImageCreateFromWBMP() returns an empty string on failure. It also outputs an error message, which unfortunately displays as a broken link in a browser. To ease debugging the following example will produce an error WBMP:

Example 1. Example to handle an error during creation (courtesy vic@zymsys.com)

function LoadWBMP ($imgname) {
    $im = @ImageCreateFromWBMP ($imgname); /* Attempt to open */
    if (!$im) { /* See if it failed */
        $im  = ImageCreate (20, 20); /* Create a blank image */
        $bgc = ImageColorAllocate ($im, 255, 255, 255);
        $tc  = ImageColorAllocate ($im, 0, 0, 0);
        ImageFilledRectangle ($im, 0, 0, 10, 10, $bgc);
        /* Output an errmsg */
        ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
    }
    return $im;
}

Note: WBMP support is only available if PHP was compiled against GD-1.8 or later.