function pImage::getTextBox_deprecated
Search API
5.x pImage.class.php | pImage::getTextBox_deprecated($X, $Y, $FontName, $FontSize, $Angle, $Text) |
File
- inc/
pchart/ pchart/ class/ pImage.class.php, line 191
Class
Code
function getTextBox_deprecated($X, $Y, $FontName, $FontSize, $Angle, $Text)
{
$Size = imagettfbbox($FontSize, $Angle, $FontName, $Text);
$Width = $this->getLength($Size [0], $Size [1], $Size [2], $Size [3]) + 1;
$Height = $this->getLength($Size [2], $Size [3], $Size [4], $Size [5]) + 1;
$RealPos [0]["X"] = $X;
$RealPos [0]["Y"] = $Y;
$RealPos [1]["X"] = cos((360 -$Angle) * PI / 180) * $Width + $RealPos [0]["X"];
$RealPos [1]["Y"] = sin((360 -$Angle) * PI / 180) * $Width + $RealPos [0]["Y"];
$RealPos [2]["X"] = cos((270 -$Angle) * PI / 180) * $Height + $RealPos [1]["X"];
$RealPos [2]["Y"] = sin((270 -$Angle) * PI / 180) * $Height + $RealPos [1]["Y"];
$RealPos [3]["X"] = cos((180 -$Angle) * PI / 180) * $Width + $RealPos [2]["X"];
$RealPos [3]["Y"] = sin((180 -$Angle) * PI / 180) * $Width + $RealPos [2]["Y"];
$RealPos [TEXT_ALIGN_BOTTOMLEFT]["X"] = $RealPos [0]["X"];
$RealPos [TEXT_ALIGN_BOTTOMLEFT]["Y"] = $RealPos [0]["Y"];
$RealPos [TEXT_ALIGN_BOTTOMRIGHT]["X"] = $RealPos [1]["X"];
$RealPos [TEXT_ALIGN_BOTTOMRIGHT]["Y"] = $RealPos [1]["Y"];
return ($RealPos);
}