* @return void
*/
public function finishImage () {
- // Get template instance
- $templateInstance = $this->getTemplateInstance();
-
// Compile width and height
- $width = $templateInstance->compileRawCode($this->getWidth());
- $height = $templateInstance->compileRawCode($this->getHeight());
+ $width = $this->getTemplateInstance()->compileRawCode($this->getWidth());
+ $height = $this->getTemplateInstance()->compileRawCode($this->getHeight());
// Set both again
$this->setWidth($width);
$this->imageResource = imagecreatetruecolor($width, $height);
// Compile background colors
- $red = $templateInstance->compileRawCode($this->backgroundColor['red']);
- $green = $templateInstance->compileRawCode($this->backgroundColor['green']);
- $blue = $templateInstance->compileRawCode($this->backgroundColor['blue']);
+ $red = $this->getTemplateInstance()->compileRawCode($this->backgroundColor['red']);
+ $green = $this->getTemplateInstance()->compileRawCode($this->backgroundColor['green']);
+ $blue = $this->getTemplateInstance()->compileRawCode($this->backgroundColor['blue']);
// Set all back
$this->initBackgroundColor();
imagefill($this->getImageResource(), 0, 0, $backColor);
// Compile foreground colors
- $red = $templateInstance->compileRawCode($this->foregroundColor['red']);
- $green = $templateInstance->compileRawCode($this->foregroundColor['green']);
- $blue = $templateInstance->compileRawCode($this->foregroundColor['blue']);
+ $red = $this->getTemplateInstance()->compileRawCode($this->foregroundColor['red']);
+ $green = $this->getTemplateInstance()->compileRawCode($this->foregroundColor['green']);
+ $blue = $this->getTemplateInstance()->compileRawCode($this->foregroundColor['blue']);
// Set all fore
$this->initForegroundColor();
switch ($this->groupable) {
case 'single': // Single image string
// Compile image string
- $imageString = $templateInstance->compileRawCode($this->getString());
+ $imageString = $this->getTemplateInstance()->compileRawCode($this->getString());
// Set it back
$this->setString($imageString);
// Compile X/Y coordinates and font size
- $x = $templateInstance->compileRawCode($this->getX());
- $y = $templateInstance->compileRawCode($this->getY());
- $size = $templateInstance->compileRawCode($this->getFontSize());
+ $x = $this->getTemplateInstance()->compileRawCode($this->getX());
+ $y = $this->getTemplateInstance()->compileRawCode($this->getY());
+ $size = $this->getTemplateInstance()->compileRawCode($this->getFontSize());
// Set the image string
imagestring($this->getImageResource(), $size, $x, $y, $imageString, $foreColor);
case 'groupable': // More than one string allowed
// Walk through all groups
- foreach ($templateInstance->getVariableGroups() as $group => $set) {
+ foreach ($this->getTemplateInstance()->getVariableGroups() as $group => $set) {
// Set the group
- $templateInstance->setVariableGroup($group, false);
+ $this->getTemplateInstance()->setVariableGroup($group, false);
// Compile image string
- $imageString = $templateInstance->compileRawCode($this->getString());
+ $imageString = $this->getTemplateInstance()->compileRawCode($this->getString());
// Compile X/Y coordinates and font size
- $x = $templateInstance->compileRawCode($this->getX());
- $y = $templateInstance->compileRawCode($this->getY());
- $size = $templateInstance->compileRawCode($this->getFontSize());
+ $x = $this->getTemplateInstance()->compileRawCode($this->getX());
+ $y = $this->getTemplateInstance()->compileRawCode($this->getY());
+ $size = $this->getTemplateInstance()->compileRawCode($this->getFontSize());
// Set the image string
//* DEBUG: */ print __METHOD__.": size={$size}, x={$x}, y={$y}, string={$imageString}<br />\n";