djlerman has asked for the wisdom of the Perl Monks concerning the following question:
I can get the center of the image:($width, $height) = $im->getBounds();
I do not know how to get the size of the text box.$centerX = $width / 2; $centerY = $height / 2;
What are some suggestions or pointers? Thank You.$black = $im->colorAllocate(0,0,0); $font_file = gdGiantFont; $text = "test"; $im->string($font_file, 400, 240, $text, $black);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Centering Text with GD::Image
by tangent (Parson) on Nov 03, 2021 at 19:40 UTC | |
by djlerman (Beadle) on Nov 03, 2021 at 21:37 UTC | |
by pryrt (Abbot) on Nov 03, 2021 at 21:43 UTC | |
|
Re: Centering Text with GD::Image
by Fletch (Bishop) on Nov 03, 2021 at 19:45 UTC | |
|
Re: Centering Text with GD::Image
by Bod (Parson) on Nov 03, 2021 at 22:45 UTC | |
by kcott (Archbishop) on Nov 04, 2021 at 04:31 UTC | |
by pryrt (Abbot) on Nov 04, 2021 at 13:21 UTC | |
by kcott (Archbishop) on Nov 05, 2021 at 06:14 UTC | |
by pryrt (Abbot) on Nov 05, 2021 at 13:56 UTC | |
| |
by Bod (Parson) on Nov 06, 2021 at 20:14 UTC | |
| |
by pryrt (Abbot) on Nov 05, 2021 at 19:43 UTC | |
by Bod (Parson) on Nov 05, 2021 at 00:29 UTC | |
by kcott (Archbishop) on Nov 05, 2021 at 07:10 UTC | |
by djlerman (Beadle) on Nov 04, 2021 at 18:41 UTC | |
by Bod (Parson) on Nov 06, 2021 at 19:31 UTC | |
by djlerman (Beadle) on Nov 15, 2021 at 20:02 UTC | |
by Bod (Parson) on Nov 16, 2021 at 13:40 UTC |