一点截图按钮屏幕变成红叉号导致卡死,弹出错误信息。币没了,求大佬们帮忙
************** 异常文本 **************
System.OutOfMemoryException: 内存不足。
在 System.Drawing.TextureBrush..ctor(Image image, WrapMode wrapMode)
在 System.Windows.Forms.ControlPaint.DrawBackgroundImage(Graphics g, Image backgroundImage, Color backColor, ImageLayout backgroundImageLayout, Rectangle bounds, Rectangle clipRect, Point scrollOffset, RightToLeft rightToLeft)
在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
在 System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
在 System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e)
在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
在 System.Windows.Forms.Control.WmPaint(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
同学,你该重启电脑了。不想重启电脑的话就去windows task manager那里关掉一些在跑的占大量内存的process吧,别把windows explore误关了就行了。不然的话就看看你那些data set里面是不是缓存了太大量的数据(无限循环、堆栈溢出),你设计的flow是否需要优化。这三招都行不通的话,你就要去买内存条了。
作者:RitaW
链接:https://www.zhihu.com/question/52923109/answer/154502383
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
http://www.cnblogs.com/daming1233/p/6389021.html
这个应该是你在处理图片的时候逻辑有错误,看到Picture控件都挂了;
1.可能是image资源被你释放了
2.拷贝太频繁。
3.建议在复制图片时new 一个bitmap使用画板来copy。