php - Transparent text with wideImage lib? -


I am using PHP and I would like to write text on the image which will be transparent in about 50%. Is this possible? Yes, this is possible, but you need to recover the TrueColor version of the image:

P> $ image = $ image-> AsTrueColor ();

Once this is done, you can do the following to write text with 50% alpha transparency:

  $ color = $ Image- & gt; AllocateColorAlpha (255, 255, 255, 63); $ Canvas = $ image- & gt; Gate canvas (); $ Canvas-> UseFont ('path / in / font.ttf', 16, $ color); $ Canvas-> Writing text ('right', 'bottom', 'hello, world!');    

Comments