PHP Classes


Recommend this page to a friend!
  Classes of Luciano Salvino   Custom Headlines   Download  
Role: Documentation
Content type: text/markdown
Description: Readme
Class: Custom Headlines
Render text headlines on the top of images
Author: By
Last change: update readme
update readme
Date: 8 years ago
Size: 1,035 bytes


Class file image Download


CustomHeadlines is a PHP class that add headlines to images with text and background color depending on the image color index of selected area


// Define parameters

// Image Source

$image = 'images/example.jpg';
// Image result
$imageResult = 'images/example_result1.jpg';
// alpha of the box area
$alpha = 40;
// text of headline
$headline = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua';
// Fontsize
$fontSize = 18;
// Box area position and measures
$areaX = 10;
$areaY = 10;
$areaW = 560;
$areaH = 90;

// Initialize Class
$ch = new CustomHeadlines();

// set font size and family

// You can set the inverse color to set text with de inverse color respect of background (optionl)
$ch->colorInverse = true; // Default: false

// Create image

// Get the image
$imgaeResult = $ch->getImage();