今天发现 framework2.0中的一个GDIPlus的Bug:

在Form的OnPaint事件里面写如下代码: 

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Pen p = new Pen(Color.Red);
            p.Width = 1;
            p.DashStyle = DashStyle.Dot;
            p.DashOffset = 1;
            e.Graphics.DrawLine(p, new Point(58, 8), new Point(58, 9));
            p.Dispose();
        }

系统会扔出outofmemory的异常,来自于Native的GDI Plus的代码。 

总结一下,条件是:

1. 线型为Dot

2.线宽为1

3.DashOffset为1

4.仅仅画一个像素



======================

MS的处理结果,他们确认这个是一个Bug,但是不准备修复一个GDIPlus的Bug -- OutofMemory异常

相关文章:

  • 2022-12-23
  • 2022-01-17
  • 2021-09-17
  • 2021-08-25
  • 2023-02-23
  • 2022-12-23
  • 2021-07-06
  • 2021-07-26
猜你喜欢
  • 2022-12-23
  • 2022-01-06
  • 2022-02-01
  • 2021-09-29
  • 2021-10-27
  • 2021-05-22
  • 2022-02-23
相关资源
相似解决方案