[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Andrea

11/15/2004 11:36:00 AM

Hello,


Can I get a character width whitout using MesureString?

Thanks,
Andrea


3 Answers

Bob Powell

11/15/2004 1:19:00 PM

0

You can get a single character widths using MeasureCharacterRanges but it's
more hassle than using MeasureString.

Why don't you want to use MeasureString?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Andrea Piccinini" <axm.pic@tiscalinet.it> wrote in message
news:%23dElDdwyEHA.352@TK2MSFTNGP14.phx.gbl...
> Hello,
>
>
> Can I get a character width whitout using MesureString?
>
> Thanks,
> Andrea
>
>


Andrea

11/15/2004 2:08:00 PM

0


>
> Why don't you want to use MeasureString?
>

I'm rewriting an older function that convert String Array to GraphicsPath,
and this function don't have graphics Parameter for use MeasureString();

GraphicsPath* MakeSimpleText(String* Lines __gc[],Drawing::Font
*TxtFont,RectangleF Rect);




Bob Powell

11/15/2004 3:07:00 PM

0

You can use CreateGraphics to get a Graphics object suitable for measuring
strings with. See the GDI+ FAQ for an article on how to get hold of the
Graphics object, when to use it and when to dispose of it.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Andrea Piccinini" <axm.pic@tiscalinet.it> wrote in message
news:%23zayByxyEHA.1564@TK2MSFTNGP09.phx.gbl...
>
> >
> > Why don't you want to use MeasureString?
> >
>
> I'm rewriting an older function that convert String Array to
GraphicsPath,
> and this function don't have graphics Parameter for use MeasureString();
>
> GraphicsPath* MakeSimpleText(String* Lines __gc[],Drawing::Font
> *TxtFont,RectangleF Rect);
>
>
>
>