本文整理匯總了PHP中Intervention\Image\Image::setBackup方法的典型用法代碼示例。如果您正苦於以下問題:PHP Image::setBackup方法的具體用法?PHP Image::setBackup怎麽用?PHP Image::setBackup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Intervention\Image\Image
的用法示例。
在下文中一共展示了Image::setBackup方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* Saves a backups of current state of image core
*
* @param \Intervention\Image\Image $image
* @return boolean
*/
public function execute($image)
{
$backupName = $this->argument(0)->value();
// clone current image resource
$image->setBackup(clone $image->getCore(), $backupName);
return true;
}
示例2: execute
/**
* Saves a backups of current state of image core
*
* @param \Intervention\Image\Image $image
* @return boolean
*/
public function execute($image)
{
// clone current image resource
$size = $image->getSize();
$clone = imagecreatetruecolor($size->width, $size->height);
imagealphablending($clone, false);
imagesavealpha($clone, true);
imagecopy($clone, $image->getCore(), 0, 0, 0, 0, $size->width, $size->height);
$image->setBackup($clone);
return true;
}
示例3: execute
/**
* Saves a backups of current state of image core
*
* @param \Intervention\Image\Image $image
* @return boolean
*/
public function execute($image)
{
$backupName = $this->argument(0)->value();
// clone current image resource
$size = $image->getSize();
$clone = imagecreatetruecolor($size->width, $size->height);
imagealphablending($clone, false);
imagesavealpha($clone, true);
$transparency = imagecolorallocatealpha($clone, 0, 0, 0, 127);
imagefill($clone, 0, 0, $transparency);
// copy image to clone
imagecopy($clone, $image->getCore(), 0, 0, 0, 0, $size->width, $size->height);
$image->setBackup($clone, $backupName);
return true;
}
示例4: execute
/**
* Saves a backups of current state of image core
*
* @param \Intervention\Image\Image $image
* @return boolean
*/
public function execute($image)
{
// clone current image resource
$image->setBackup(clone $image->getCore());
return true;
}