• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/captcha.php
  • Класс: CCaptcha
  • Вызов: CCaptcha::CreateImage
function CreateImage()
{
	$this->image = $this->InitImage();

	$this->DrawEllipses();

	if (!$this->bLinesOverText)
		$this->DrawLines();

	$right_border = $this->DrawText();
//			if($right_border < ($this->imageWidth - $this->textStartX))
//			{
//				$img2 = $this->InitImage();
//				imagecopy($img2, $this->image,
//					$this->textStartX + rand(0, $this->imageWidth - $right_border - $this->textStartX), 0,
//					$this->textStartX, 0,
//					$right_border - $this->textStartX, $this->imageHeight
//				);
//				$this->image = $img2;
//			}

	if ($this->bLinesOverText)
		$this->DrawLines();

	if($this->bWaveTransformation)
	{
		$this->Wave();
	}

	$arBorderColor = $this->GetColor($this->arBorderColor);
	$borderColor = imagecolorallocate($this->image, $arBorderColor[0], $arBorderColor[1], $arBorderColor[2]);
	imageline($this->image, 0, 0, $this->imageWidth-1, 0, $borderColor);
	imageline($this->image, 0, 0, 0, $this->imageHeight-1, $borderColor);
	imageline($this->image, $this->imageWidth-1, 0, $this->imageWidth-1, $this->imageHeight-1, $borderColor);
	imageline($this->image, 0, $this->imageHeight-1, $this->imageWidth-1, $this->imageHeight-1, $borderColor);
}