(PHP 7 >= 7.2.0, PHP 8)
imagebmp — Output a BMP image to browser or file
Outputs or saves a BMP version of the given image
.
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 thecompressed
arguments is not used.
compressed
Whether the BMP should be compressed with run-length encoding (RLE), or not.
Başarı durumunda true
, başarısızlık durumunda false
döner.
Ancak, libgd görüntüyü çıktılamakta başarısız olursa bu işlev true
döndürür.
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.
|
Örnek 1 Saving a BMP file
<?php
// Create a blank image and add some text
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'BMP with PHP', $text_color);
// Save the image
imagebmp($im, 'php.bmp');
// Free up memory
imagedestroy($im);
?>