Answer the question
In order to leave comments, you need to log in
How to change the image size in bitrisk news?
How I try to do this and it doesn't work:
<?
$renderImage = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"], Array("width" => 200, "height" => 100), BX_RESIZE_IMAGE_EXACT, false);
echo '<img alt="'.$arItem["NAME"].'" src="'.$renderImage["src"].'" />';
?>
Answer the question
In order to leave comments, you need to log in
almost all CFile methods work with a file ID. Give it to him and you will be happy
this is the array that the component returned to you.
Reading the documentation
And we understand that the component can return something completely different from what the СFile class wants.
UPD
from the links provided
Enlarging the image in ANY way will result in a loss of quality. If you need to enlarge the picture, find it with dimensions larger than necessary and reduce it to the required size.
If you are using a component and your code is in a template
Try this:
<?
$renderImage = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"]['ID'], Array("width" => 200, "height" => 100), BX_RESIZE_IMAGE_EXACT, false);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question