[TYPO3-english] Text to Image in Extention

bernd wilke x00nsji02 at sneakemail.com
Mon Oct 26 19:44:03 CET 2009


Am Mon, 26 Oct 2009 13:58:19 +0000 schrieb Clay Sissing:

> Hi Guys
> 
> 
>  
> Created my own extention using kickstart editor. I want to take text and
> create a image with it. The code im using is only creating a image of a
> black square but no text in not converted to image as well.
> 
> 
>  
> This is my code below:
> 
> 
>  
>         $this->gifCreator = t3lib_div::makeInstance('tslib_gifBuilder');
> 
>        $this->gifCreator->init();
> 
> 
>  
>         //$row = 'hello world';
> 
> 
>  
>         $conf = array(
> 
>             'XY' => '[10.w]+10 ,20',
> 
>             'transparentBackground' => '0',
> 
>             'backColor' =>'#000',
> 
>             '10' => 'TEXT',
> 
>             //'10.text' => 'test',
> 
>             '10.fontSize' => '20',
> 
>             '10.text.field' => 'test',
> 
>             '10.fontFile' => 'fileadmin/templates/font/bjorkfont.ttf',
> 
>             '10.fontColor' => '#636564',
> 
>             '10.offset' => '0,17'
> 
> );
> 
> 
>  
>         $this->gifCreator->start($conf,$data);
> 
>         $test ='<img src="'.$this->gifCreator->gifBuild().'">';
> 
> 
>  
> Any ideas will be welcomed.
 
 
are you sure your configuration data is correct?


maybe it should be something like:

          '10' => 'TEXT',
          '10.' => array(
		//	'text' => 'test',
             		'fontSize' => '20',
             		'text.' => array('field' => 'test'),
             		'fontFile' => 'fileadmin/templates/font/
bjorkfont.ttf',
             		'fontColor' => '#636564',
			'offset' => '0,17'
			),
	);

and why don't you use $this->cObj->IMAGE() ?

compare to http://www.pi-phi.de/rendering.html#c176 (Bilder II)


bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list