Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

imagecreatefromwbmp

Description

The imagecreatefromwbmp of Image for PHP create a new image from file or URL.

Syntax

imagecreatefromwbmp(
    string $filename
): GdImage|false

Parameters

filename

Path to the WBMP image.

Return

Returns an image object on success, false on errors.

Examples

1 · return

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/wbmp/1.wbmp';

$return = imagecreatefromwbmp($filename);

var_dump($return);

?>
object(GdImage)#1 (0) {
}

2 · base64

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/wbmp/1.wbmp';
$image = imagecreatefromwbmp($filename);

ob_start();

    imagepng($image);

$output = ob_get_clean();

echo '<!doctype html>
<html>
<body>
    <img src="data:image/png;base64,' . base64_encode($output) . '">
</body>
</html>';

?>
<!doctype html>
<html>
<body>
    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkAQMAAABKLAcXAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAGUlEQVQ4jWP4jwQ+MIzyRnmjvFHeKI/GPAC+6wlcSlCabgAAAABJRU5ErkJggg==">
</body>
</html>
HomeMenu