如何解决错误“及时调试-内存不足"?使用GDI ++? [英] How to solve error "Just-In-Time Debugging - Out of memory" with GDI++?

查看:157
本文介绍了如何解决错误“及时调试-内存不足"?使用GDI ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用GDI ++(带有Point F 参数的DrawLine()函数),我对其进行了编译(在Win7系统上是VS2008),当我在Win7系统上运行时,它运行良好,我在WinXP-生成错误:


I used GDI++ (DrawLine() function with PointF parameters), I compiled it (by VS2008 on Win7 system), when I run it on Win7 system it run well, I run it on WinXP - it generates an error:


See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.OutOfMemoryException: Out of memory.
   at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
   at System.Drawing.Graphics.DrawLine(Pen pen, Single x1, Single y1, Single x2, Single y2)
   at System.Drawing.Graphics.DrawLine(Pen pen, PointF pt1, PointF pt2)
   at pTPTCoi.uDothi.uDothi_Paint(Object sender, PaintEventArgs e)
   at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.UserControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



我该如何解决这个错误?谢谢.



How i can solve this error? Thanks.

推荐答案

谢谢.我发现了这个错误.在区块:

Thank you. I have found that error. At block:

float[] dashValues = { 5, 2, 5 };
Pen penLuoi = new Pen(Color.Olive, 1);
penLuoi.DashPattern = dashValues;



我删除了dashValues,取而代之的是:



I removed dashValues and instead it to:

Pen penLuoi = new Pen(Color.Olive, 1.0F);
penLuoi.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;



这很好.我解决了谢谢大家.



It''s very good. I solved. Thanks all.


这篇关于如何解决错误“及时调试-内存不足"?使用GDI ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆