Documentation

ResizedImage

\Bitrix\Main\Engine\Response\ResizedImage - methods for reducing image sizes.

Methods

Method Description Available from version
__construct(
   array $imageData,
   $width,
   $height,
   $name
)
Constructs object ResizedImage, using previously generated $imageData. Parameters:
  • $imageData {array} - array, describing file, see , см. \CFile::getFileArray()
  • $width {int} - resulting image width.
  • $height {int} - resulting image height.
  • $name {string} - name for download image.
createByImageData(
   array $imageData,
   $width,
   $height,
   $name)
Creates ResizedImage object by using previously generated $imageData. Parameters:
  • $imageData {array} - array, describing file, see. \CFile::getFileArray()
  • $width {int} - resulting image width.
  • $height {int} - resulting image height.
  • $name {string} - name for download image.
createByImageId(
   $imageId, $width,
   $height,
   $name
)
Creates ResizedImage object, by using previously generated $imageData. Parameters:
  • $imageId {int} - file ID from table b_file.
  • $width {int} - resulting image width.
  • $height {int} - resulting image height.
  • $name {string} - name for download image.
setWidth(
   $width
)
Sets resulting image width.
setHeight(
   $height
)
Sets resulting image height.
setResizeType(
   $resizeType
)
{int}. Selects resize type:
BX_RESIZE_IMAGE_EXACT,
BX_RESIZE_IMAGE_PROPORTIONAL_ALT,
BX_RESIZE_IMAGE_PROPORTIONAL.

© «Bitrix24», 2001-2024
Up