g.DrawLine(pen, 0, 0, 1, 0);
}
}
-----------------------------------------
An OutOfMemoryException was be throw when we excute it.
The key points about above code is :
1. The Alpha channel of the pen's color is 255. Otherwise, the exception
is not throw, but the drawing is error.
2. All visible points of the line is blank. (in above code, I adjust the
dashoffset to 1 to ignore the first point about dot line).
I think it is bug for GDI+ or .NET FWK. But I must use it in my product. and
catch the exception is so slow for performance view.
Who can help me or tall me why this problem ocurre or help me to avoid this
problem.
------------------------------------------
Sorry, My English is so poor. orz
Thanks...
Because I cannot debug into the unmanaged DLL I don't know exactly why
the problem occurs but it's a problem.
I will try to escalate this to Microsoft.
--
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.
We've experienced 'Out of memory exceptions' on a lot of occassions
when Drawing very small stuff.
Lines, Polygon, whatever, so we decided to put a try catch block
around it and are now considering moving to WPF.
Patrick
Thanks.