本文整理汇总了PHP中Intervention\Image\Image::heighten方法的典型用法代码示例。如果您正苦于以下问题:PHP Image::heighten方法的具体用法?PHP Image::heighten怎么用?PHP Image::heighten使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Intervention\Image\Image
的用法示例。
在下文中一共展示了Image::heighten方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process(Image $image)
{
if ($this->request->query->has('height') && 1 === preg_match('#^([0-9]+)$#', $this->request->query->get('height'), $height)) {
$image->heighten($height[1], function (Constraint $constraint) {
$constraint->upsize();
});
}
}
示例2: scale
/**
* Scales an image to the given width and height while maintaining aspect ratio.
*
* The resulting image can be smaller for one or both target dimensions.
*
* @param int $width
* The target width, in pixels. This value is omitted then the scaling will
* based only on the height value.
* @param int $height
* The target height, in pixels. This value is omitted then the scaling will
* based only on the width value.
*/
public function scale($width = null, $height = null)
{
if ($width === null && $height === null) {
throw new \LogicException('one of "width" or "height" must be set for "scale"');
}
if ($width !== null && $height !== null) {
$this->resize($width, $height);
return;
}
if ($width !== null) {
$this->image->widen($width);
return;
}
$this->image->heighten($height);
}
示例3: handle
/**
* Handle the image manipulation request
* @param \Intervention\Image\Image $image
* @param array $options
* @return \Intervention\Image\Image
*/
public function handle($image, $options)
{
$options = array_merge($this->defaults, $options);
$callback = isset($options['callback']) ? $options['callback'] : null;
return $image->heighten($options['height'], $callback);
}
示例4: heighten
/**
* Resize image to new height, constraining proportions
*
* @param integer $height
* @return \Intervention\Image\Image
* @static
*/
public static function heighten($height)
{
return \Intervention\Image\Image::heighten($height);
}