Some sort of compilable code that reproduces the problem will help to find
All new articles provide code in C# and VB.NET.
"schneider" <eschneider@ooooooooo.com> wrote in message
news:OeweN%23LfIHA.1164@TK2MSFTNGP02.phx.gbl...
>I can, just don't think it will help much:
>
> Friend Function CalculateStringSize(ByVal canvas As Graphics) As Size
>
> If canvas Is Nothing Then Throw New ArgumentNullException("canvas",
> m_StringManager.GetString("nonullallowed",
> System.Globalization.CultureInfo.CurrentUICulture))
>
> If Font Is Nothing Then Throw New ArgumentNullException("font",
> m_StringManager.GetString("nonullallowed",
> System.Globalization.CultureInfo.CurrentUICulture))
>
> 'Dim gstate As GraphicsState = canvas.Save
>
> Dim ct As TextRenderingHint = canvas.TextRenderingHint
>
> canvas.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
>
> Dim sz As SizeF = canvas.MeasureString(Me.Text, Font)
>
> sz.Width = sz.Width + CSng(sz.Width * 0.0125) + 1 '0.0125)
>
> 'canvas.Restore(gstate)
>
> canvas.TextRenderingHint = ct
>
> Dim s As New Size(CInt(sz.Width), CInt(sz.Height))
>
> Return s
>
> End Function
>
>
>
> "Bob Powell [MVP]" <bob@spamkillerbobpowell.net> wrote in message
> news:87386324-AFC5-4C6F-84B1-C0104F40D202@microsoft.com...
>> Can you post an example of when this occurs?
>>
>> --
>> --
>> Bob Powell [MVP]
>> Visual C#, System.Drawing
>>
>> Ramuseco Limited .NET consulting
>>
http://www.ramuseco.com >>
>> Find great Windows Forms articles in Windows Forms Tips and Tricks
>>
http://www.bobpowell.net/tipstricks.htm >>
>> Answer those GDI+ questions with the GDI+ FAQ
>>
http://www.bobpowell.net/faqmain.htm >>
>> All new articles provide code in C# and VB.NET.
>> Subscribe to the RSS feeds provided and never miss a new article.
>>
>>
>> "schneider" <eschneider@ooooooooo.com> wrote in message
>> news:OJ1JATweIHA.3724@TK2MSFTNGP02.phx.gbl...
>>> Under some cases Graphics.TextRenderingHint and also Graphics.Save
>>> throws an exception?
>>>
>>> I can't seem to understand why. or what I'm doing wrong? and the error
>>> message is useless.
>>>
>>> Anyone know whats going on?
>>>
>>> Thanks
>>> Schneider
>>>
>>
>
>