本文整理匯總了PHP中imagick::readImageBlob方法的典型用法代碼示例。如果您正苦於以下問題:PHP imagick::readImageBlob方法的具體用法?PHP imagick::readImageBlob怎麽用?PHP imagick::readImageBlob使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類imagick
的用法示例。
在下文中一共展示了imagick::readImageBlob方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _read_image_blob
/**
* Internal method to read image from blob (string)
*
* @param string the binary data to be read
* @return mixed an instance of the image based on library (driver), false on failure
*/
protected function _read_image_blob($string)
{
switch (self::$driver) {
case 'gd':
return imagecreatefromstring($string);
case 'gmagick':
case 'imagick':
$image = new imagick();
$image->readImageBlob($string);
return $image;
}
return FALSE;
}
示例2: imagick
function get_texture($uuid, $x = null, $y = null)
{
$image = $this->ci->curl->simple_get($this->asset_service . $uuid);
if ($image == null) {
return null;
}
$im = new imagick();
$im->readImageBlob($image);
$im->setImageFormat("jpeg");
if ($x != null && $y != null) {
$im->scaleImage(200, 200, true);
}
return $im;
}
示例3: imagick
$signatureColor = $_POST['colorSignature'];
$titleFont = $_POST['selectTitleFont'];
$messageFont = $_POST['selectMessageFont'];
$signatureFont = $_POST['selectSignatureFont'];
//add hash to text color strings
$titleColor = '#' . $titleColor;
$messageColor = '#' . $messageColor;
$signatureColor = '#' . $signatureColor;
# URL's from the web
$board = "http://sometestsite.com/christmas-card-maker/images/cards/" . $selectedImage . ".png";
# read files
$board_blob = file_get_contents($board);
# create new image objects
$b = new imagick();
# read blobs
$b->readImageBlob($board_blob);
/* Draw Title */
$draw1 = new ImagickDraw();
/* Black text */
$draw1->setFillColor($titleColor);
/* Font properties */
$draw1->setFont($titleFont);
$draw1->setFontSize($titleSize);
$draw1->setFontWeight(400);
// change wordwrap depending on font size
switch ($titleSize) {
case 20:
$titleWordwrap = 24;
break;
case 22:
$titleWordwrap = 23;