首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ImagickPixel::setColorValueQuantum

(No version information available, might only be in Git)

ImagickPixel::setColorValueQuantum — Description

Description

代码语言:javascript
复制
public void ImagickPixel::setColorValueQuantum ( int $color , mixed $value )

Sets the quantum value of a color element of the ImagickPixel.

Warning

This function is currently not documented; only its argument list is available.

Parameters

color

Which color element to set e.g. \Imagick::COLOR_GREEN.

value

The quantum value to set the color element to. This should be a float if ImageMagick was compiled with HDRI otherwise an int in the range 0 to Imagick::getQuantum().

Return Values

Examples

Example #1 ImagickPixel::setColorValueQuantum()

代码语言:javascript
复制
<?php
function?setColorValueQuantum()?{
????$image?=?new?\Imagick();

????$quantumRange?=?$image->getQuantumRange();

????$draw?=?new?\ImagickDraw();
????$color?=?new?\ImagickPixel('blue');
????$color->setcolorValueQuantum(\Imagick::COLOR_RED,?128?*?$quantumRange['quantumRangeLong']?/?256);

????$draw->setstrokewidth(1.0);
????$draw->setStrokeColor($color);
????$draw->setFillColor($color);
????$draw->rectangle(200,?200,?300,?300);

????$image->newImage(500,?500,?"SteelBlue2");
????$image->setImageFormat("png");

????$image->drawImage($draw);

????header("Content-Type:?image/png");
????echo?$image->getImageBlob();
}

?>

← ImagickPixel::setColorValue

ImagickPixel::setHSL →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com