• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/captcha.php
  • Класс: CCaptcha
  • Вызов: CCaptcha::InitImage
function InitImage($width = false, $height = false)
{
	if(!$width)
		$width = $this->imageWidth;
	if(!$height)
		$height = $this->imageHeight;
	$image = imagecreatetruecolor($width, $height);
	if(!$this->arRealBGColor)
	{
		$this->arRealBGColor = $this->GetColor($this->arBGColor);
	}
	$bgColor = imagecolorallocate($image, $this->arRealBGColor[0], $this->arRealBGColor[1], $this->arRealBGColor[2]);
	imagefilledrectangle($image, 0, 0, imagesx($image), imagesy($image), $bgColor);
	return $image;
}