Jump to content

underline the text using gd libarary


angela_john

Recommended Posts

Here is the image and code

 

<?php
//<img src="quick-image.php" alt="you are so sweet " width="200" height="100">
$start_left_line = 30;
$end_right_line = 160;
$left_tilt = 45;
$right_tilt = 45;
$quick_img = imagecreate( 200, 100 );
$background = imagecolorallocate( $quick_img, 192, 255, 255 );
$text_color = imagecolorallocate( $quick_img, 238, 44, 44 );
$line_color = imagecolorallocate( $quick_img, 255, 246, 143 );
imagestring( $quick_img, 4, 30, 25, "you are so sweet",
  $text_color );
imagesetthickness ( $quick_img, 5 );
imageline( $quick_img, $start_left_line, $left_tilt, $end_right_line, $right_tilt, $line_color );

header( "Content-type: image/png" );
imagepng( $quick_img );
imagecolordeallocate( $line_color );
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $quick_img );

?>

 

If would like to see the result look here.

http://dynaindex.com/quick-image

 

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.