Usage example:
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'tkimage_test');
// ######################### REQUIRE BCK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/class_tkimage.php');
// ###################### Load the image handler ########################
$imagehandler = tk_Image::get_instance($vbulletin);
// get the avatar
$hdst = $imagehandler->fetch_image('avatar.gif');
$dwidth = $imagehandler->fetch_width($hdst);
$dheight = $imagehandler->fetch_height($hdst);
// create a backdrop
$htmp = $imagehandler->create_truecolor($dwidth, $dheight, $hdst);
// get the 'egg'
$hsrc = $imagehandler->fetch_image('egg.gif');
$swidth = $imagehandler->fetch_width($hsrc);
$sheight = $imagehandler->fetch_height($hsrc);
// copy it onto the avatar/backdrop
$imagehandler->copy_image($htmp, $hsrc, 10, 10, 0, 0, $swidth, $sheight);
// prepare it and output it
$imagehandler->process_for_output($htmp);
$imagehandler->output($htmp);
// clean up
$imagehandler->destroy_image($hsrc);
$imagehandler->destroy_image($hdst);
$imagehandler->destroy_image($htmp);
?>