Jump to content

image border


mishuk

Recommended Posts

Below is the code for an image i am playing around with and i was wondering how i would create a border for the image as it currently does not have one.

 

<?php
//set up image
$height = 200;
$width = 200;
$im = ImageCreateTrueColor($width, $height);
$white = ImageColorAllocate ($im, 255, 255, 255);
$blue = ImageColorAllocate ($im, 0, 0, 64);
$black = ImageColorAllocate ($im, 0, 0, 0);
$grey = ImageColorAllocate ($im, 200, 200, 200);

ImageFill($im, 0, 0, $grey);
ImageLine($im, 0, 0, $width, $height, $white);
ImageString($im, 4, 50, 150, 'Sales', $white);

Header ('Content-type: image/png');
ImagePng ($im);

ImageDestroy($im);
?>

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/38331-image-border/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.