From: Luigino on
Hello everyone,

I'm trying to draw a legenda on memDC like:

colour square : description | colour square : description |....

since I need to apply an offset, is there a function or something to
calculate the relative length of strings on graphic surface?...
I think a character correspond to certain dot pitch length multiplied
to n-chars of the string...

Thanks
Ciao
Luigi
From: Mikel on
On 8 mar, 10:44, Luigino <npul...(a)rocketmail.com> wrote:
> Hello everyone,
>
> I'm trying to draw a legenda on memDC like:
>
> colour square : description | colour square : description |....
>
> since I need to apply an offset, is there a function or something to
> calculate the relative length of strings on graphic surface?...
> I think a character correspond to certain dot pitch length multiplied
> to n-chars of the string...
>
> Thanks
> Ciao
> Luigi

Take a look at CDC::GetTextExtent CDC::GetOutputTextExtent and similar
ones
From: David Lowndes on
>since I need to apply an offset, is there a function or something to
>calculate the relative length of strings on graphic surface?...

Have a look at the GetTextExtentPoint32 API.

Dave
From: Luigino on
On 8 Mar, 11:17, David Lowndes <Dav...(a)example.invalid> wrote:
> >since I need to apply an offset, is there a function or something to
> >calculate the relative length of strings on graphic surface?...
>
> Have a look at the GetTextExtentPoint32 API.
>
> Dave

Tryed it! and it worked! Thanks Dave!! :-)