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