PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Abius X   Pure PHP Text Render   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: sample usages
Class: Pure PHP Text Render
Render text in an image in pure PHP
Author: By
Last change: Updated rotation example
Date: 9 years ago
Size: 363 bytes
 

Contents

Class file image Download
<?php
require_once __DIR__."/pure_text_render.php";
$obj=new PureTextRender();
$text="Hello there people!".PHP_EOL."This is rendered using only PHP...";
$bitmap=$obj->text_bitmap($text);
$size=$obj->text_size($text);
list(
$rotated,$size[0],$size[1])=$obj->rotate_bitmap($bitmap,$size[0],$size[1],10);
$obj->display_bitmap($size[0],$size[1],$rotated);