PHP code example of mswarak / write-to-image
1. Go to this page and download the library: Download mswarak/write-to-image library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mswarak / write-to-image example snippets
// load Write_To_Image
use mswarak\Write_To_Image;
$image = new Write_To_Image('img.jpg');
// add default font
$image->set_default_font(dirname(__FILE__) . "/arial.ttf");
// add text
$image->text_ltr("hi 01", 25, 50, 50);
$image->text_ltr("hi 02", 25, 250, 250);
// preview image on browser
$image->preview();