Imagick::getImageWhitePoint()函數是PHP中的一個內置函數,用於獲取Imagick對象的色度白點。
用法:
bool Imagick::getImageWhitePoint( void)
參數:該函數不接受任何參數。
返回值:此函數以鍵值x和y的關聯數組形式返回色度白點。
以下示例程序旨在說明PHP中的Imagick::getImageWhitePoint()函數:
示例1:
原始圖片:
<?php
// Craeate new imagic object
$imagick = new Imagick(
'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-15.png');
// Getting Length of image
// using getimagerelength function
$res = $imagick->getImageWhitePoint();
// Display result
print_r($res);
?>
輸出:
Array ( [x] => 0.31270000338554 [y] => 0.3289999961853 )
示例2:
原始圖片:
<?php
$string = "Computer Science portal for Geeks!";
// Creating new image of above String
// and add color and background
$im = new Imagick();
$draw = new ImagickDraw();
// Fill the color in image
$draw->setFillColor(new ImagickPixel('green'));
// Set the text font size
$draw->setFontSize(50);
$metrix = $im->queryFontMetrics($draw, $string);
$draw->annotation(0, 40, $string);
$im->newImage($metrix['textWidth'], $metrix['textHeight'],
new ImagickPixel('white'));
// Draw the image
$im->drawImage($draw);
// getting Length of image
// using getimagerelength function
$res = $im->getImageWhitePoint();
// Display result
print_r($res);
?>
輸出:
Array ( [x] => 0.31270000338554 [y] => 0.3289999961853 )
參考: http://php.net/manual/en/imagick.getimagewhitepoint.php
相關用法
- PHP Gmagick getimagewhitepoint()用法及代碼示例
- PHP Imagick getImageChannelStatistics()用法及代碼示例
- PHP Imagick getImageClipMask()用法及代碼示例
- PHP Imagick getImageCompose()用法及代碼示例
- PHP Imagick setImageClipMask()用法及代碼示例
- PHP Imagick getImageChannelExtrema()用法及代碼示例
- PHP Imagick setImageBorderColor()用法及代碼示例
- PHP Imagick haldClutImage()用法及代碼示例
- PHP Imagick getImageBackgroundColor()用法及代碼示例
- PHP Imagick getImageChannelDistortion()用法及代碼示例
- PHP Imagick setImageBluePrimary()用法及代碼示例
- PHP Imagick getImageBorderColor()用法及代碼示例
- PHP Imagick setImageBackgroundColor()用法及代碼示例
- PHP Imagick getImageChannelMean()用法及代碼示例
- PHP Imagick getImagesBlob()用法及代碼示例
注:本文由純淨天空篩選整理自R_Raj大神的英文原創作品 PHP | Imagick getImageWhitePoint() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。