gflAddText: Width and height of text

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

plamark
Posts: 4
Joined: Tue Feb 22, 2005 9:16 pm

gflAddText: Width and height of text

Post by plamark »

I would like to use gflAddText to automatically place and center text at the bottom of images. In order to do this, I need to be able to calculate the rendered width and height of the text string. Is there a way to determine what the dimensions are of a rendered text string before placing it into the image? I have thought about using the Windows API call DrawText or similar to calculate these dimensions, but wanted to make sure that the returned values would be relevant to the way that the gfl sdk does things.

Thanks

Mark
User avatar
xnview
Author of XnView
Posts: 45870
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: gflAddText: Width and height of text

Post by xnview »

plamark wrote:I would like to use gflAddText to automatically place and center text at the bottom of images. In order to do this, I need to be able to calculate the rendered width and height of the text string. Is there a way to determine what the dimensions are of a rendered text string before placing it into the image? I have thought about using the Windows API call DrawText or similar to calculate these dimensions, but wanted to make sure that the returned values would be relevant to the way that the gfl sdk does things.
Yes, currently no way to get these values, you can use DrawText...
Pierre.