Access Violation in GDI+

  • Thread starter Thread starter AndrewEames
  • Start date Start date
A

AndrewEames

The following code access violates in GDI+ in the call to DrawEllipse - Can
someone give me a workaround (or look into it and tell me what tickles the
bug)
Thanks
Andrew

BufferedGraphics bg =
BufferedGraphicsManager.Current.Allocate(CreateGraphics(), new
Rectangle(0,0,485,310));
using (Pen pen = new Pen(Color.Black))
{
pen.DashStyle = DashStyle.Dash;
bg.Graphics.DrawEllipse(pen, (float)174.89508486174867,
(float)-0.71447265459268827, (float)30.9574471, (float)30.9574471);
}
 
The problem seems to be in the pen you allocate. If I take the dashstyle off
it works just fine.


--
--
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.
 
Well yes - if I change anything (including any of the numbers) it works just
fine - thats not really the point though - I want the dashstyle in my app :)
Andrew
 
Back
Top