Re: Graphics.TextRenderingHint throw exception?
- From: "Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 06 Mar 2008 18:29:37 +0100
I bet you're caching one you've been given.
The owner will call dispose on it an you'll be left with a disposed reference.
Don't cache Graphics objects.
Mind you, if you just posted all the code instead of feeding us snippets and frustration we'd be able to see and point out the mistakes instead of having to get the ideas through a process of divination...
--
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 wrote:
I still can't figure this out. Some how I invalidate the Graphics object..
Graphics.Save
Graphics.TextRenderHint
Graphics.MeasureString
all throw ArgumentException "Parameter is not valid.", and I'm not disposing it.
Anyone have any ideas?
Thanks,
Schneider
"schneider" <eschneider@xxxxxxxxxxxxx> wrote in message news:OJ1JATweIHA.3724@xxxxxxxxxxxxxxxxxxxxxxxUnder 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
- Follow-Ups:
- Re: Graphics.TextRenderingHint throw exception?
- From: schneider
- Re: Graphics.TextRenderingHint throw exception?
- References:
- Re: Graphics.TextRenderingHint throw exception?
- From: schneider
- Re: Graphics.TextRenderingHint throw exception?
- Prev by Date: Re: Graphics.TextRenderingHint throw exception?
- Next by Date: Re: String drawing gives me headache... advise very welcome
- Previous by thread: Re: Graphics.TextRenderingHint throw exception?
- Next by thread: Re: Graphics.TextRenderingHint throw exception?
- Index(es):
Relevant Pages
|