imagebmp

(PHP 7 >= 7.2.0, PHP 8)

imagebmpOutput a BMP image to browser or file

Açıklama

imagebmp(GdImage $image, resource|string|null $file = null, bool $compressed = true): bool

Outputs or saves a BMP version of the given image.

Değiştirgeler

görüntü

imagecreatetruecolor() gibi bir görüntü oluşturma işlevinden dönen bir GdImage nesnesi.

file

Dosyanın kaydedileceği yol veya işlev döndüğünde kendiliğinden kapanan açık bir akım kaynağı. null atanırsa veya hiçbir şey atanmazsa doğrudan ham görüntü akımı çıktılanır.

Bilginize:

null is invalid if the compressed arguments is not used.

compressed

Whether the BMP should be compressed with run-length encoding (RLE), or not.

Dönen Değerler

Başarı durumunda true, başarısızlık durumunda false döner.

Dikkat

Ancak, libgd görüntüyü çıktılamakta başarısız olursa bu işlev true döndürür.

Sürüm Bilgisi

Sürüm: Açıklama
8.0.0 görüntü değiştirgesinde artık bir GdImage nesnesi aktarmak gerekiyor; evvelce resource türünde bir değer gerekirdi.
8.0.0 The type of compressed is bool now; formerly it was int.

Örnekler

Örnek 1 Saving a BMP file

<?php
// Create a blank image and add some text
$im imagecreatetruecolor(12020);
$text_color imagecolorallocate($im2331491);

imagestring($im155,  'BMP with PHP'$text_color);

// Save the image
imagebmp($im'php.bmp');

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

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top