|
|
How can i generate an image using Gifbuilder from my extensionIn order to generate a text as an image from your extension you need to initialize first the gifbuilder with the following code
$this->gifCreator = t3lib_div::makeInstance('tslib_gifBuilder');
$this->gifCreator->init();
This is absolutely necessary in order to generate the images. Next you provide a configuration array for the gifbuilder and then you output the image. Here is the full code snippet:
$this->gifCreator = t3lib_div::makeInstance('tslib_gifBuilder');
$this->gifCreator->init();
$conf=array(
'XY' => '[10.w]+10 ,20',
'transparentBackground' => '1',
'backColor' =>'#ECECEC',
'10' => 'TEXT',
'10.'=> array(
'text' => 'The text to be generated as an image',
'fontSize' => '15',
'fontFile' => 'fileadmin/templates/font/arial.ttf',
'fontColor' => '#909090',
'offset' => '0,17'
),
);
$this->gifCreator->start($conf,$data);
$mytitle='<img src="'.$this->gifCreator->gifBuild().'">';
General aspects : | TYPO3 | TYPO3 Installation | TYPO3 Configuration | TYPO Administration | TYPO3 Performance |TYPO3 Troubleshooting | TYPO3 Glossary | Development : | Typoscript | TYPO3 Extensions - TER | TYPO3 API | TYPO3 Extension Development | Extbase | Fluid? | 3rd party | Back to > CMS |
Google SearchLogin |