I have been working on a project trying to write text to an image using php gd library. I have succeeded in generating the image and outputing it to the browser. What I want to know is... is there a way I could get the image to popup on the same page without loading and displaying the image in the php file that contains the code for creating and writing text to the image? Thanks in advance for your help.
My code:
<?php
//Set content type
header('Content-type: image/jpeg');
// Create image from existing image
$jpgImage = imagecreatefromjpeg('file.jpg');
// Allocate color for text
$white = imagecolorallocate($jpgImage, 255, 255, 255);
// Set Path to Font File
$font = 'arialbd.ttf';
// Text to print to image
$text = 'Testing text output';
// Print Text On Image
imagettftext($jpgImage, 75, 0, 50, 400, $white, $font, $text);
// Send Image to Browser
imagejpeg($jpgImage);
// Clear Memory
imagedestroy($jpgImage);
?>
Can Bootstrap 3 be used to accomplish this task? Thank you