Veronica's Text on an Image

Confetti Image with Text
Image courtesy of Jason Leung on unsplash



SLAVE CODE FOLLOWS

<?php // combine text with image

$name "H o o r a y !";

// get the images from files
$image imagecreatefromjpeg("../images/jason-leung-Xaanw0s0pMk-unsplash_sm.jpg");

// get sizes
$width imagesx($image);
$height imagesy($image);

$font "fonts/arial.ttf";

// sets the current foreground color
$color imagecolorallocate($image1702550);

// combines the image with text using the following specs
// (image, font-size, angle-rotation, x-coord, y-coord, text-color, font-name, text)
imagettftext($image201820$height 8$color$font$name);

//=== display the image

// tell the server that a PNG image  follows
header("Content-type: image/png");

// display the image
imagepng($image);

// destroy the image (i.e., release memory)
imagedestroy ($image);

?>
 

CODE FOLLOWS

<?php

include('includes/header.php');
?>

    <h1>Veronica's Text on an Image</h1>

    <img src="image_text.php" alt="Confetti Image with Text">

<?php
echo("<br> Image courtesy of Jason Leung on unsplash <br><br>");

// code for slave routine
echo('<hr><br>SLAVE CODE FOLLOWS<br><br>');
highlight_file ('image_text.php');

include(
'includes/footer.php');
?>