本文整理汇总了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;