开发者

How can I auto adjust the width of a GD-generated image to fit the text?

I'm trying to display a number using GD. This number changes, so sometimes the width needs to change. Is there a开发者_如何转开发 way to calculate how wide the text will be so that I can dynamically set the width?


Yes, you can find out the dimensions of a text using imagettfbbox() (or imageftbbox() if you're using Freetype).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜