Imagestring - Larger Font or Image Size?
From: David McCulloch (|_at_|.|)
Date: 04/28/04
- Next message: Berislav Lopac: "Re: PHP Version 4.3.2 OO Hole???"
- Previous message: ScareCrowe: "Re: What's up with the double dollar sign? ($$)"
- Next in thread: Joachim Mæland: "Re: Imagestring - Larger Font or Image Size?"
- Reply: Joachim Mæland: "Re: Imagestring - Larger Font or Image Size?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Apr 2004 21:50:45 -0500
QUESTION: How can I increase either the font-size used by "imagestring" or
the overall image size so as to stretch the font in either or both
dimensions?
I am new to PHP's image capabilities. When I create a file as follows, I
would like a font-size of 1.5- to 2-times what I actually see.
$string = "123456";
$font = 5;
$factor = 1;
$width = ImageFontWidth($font) * strlen($string) * $factor;
$height = ImageFontHeight($font) * $factor;
$im = @imagecreate ($width,$height);
$back_color = imagecolorallocate ($im, 231, 231, 247);
$text_color = imagecolorallocate ($im, 0, 0, 0);
imagefill($im, 0, 0, $back_color);
imagestring($im, $font, 0, 0, $string, $text_color);
header ("Content-type: image/jpeg");
imagejpeg($im);
Any help would be greatly appreciated!
Dave
- Next message: Berislav Lopac: "Re: PHP Version 4.3.2 OO Hole???"
- Previous message: ScareCrowe: "Re: What's up with the double dollar sign? ($$)"
- Next in thread: Joachim Mæland: "Re: Imagestring - Larger Font or Image Size?"
- Reply: Joachim Mæland: "Re: Imagestring - Larger Font or Image Size?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|