GDI + This.Close()的通用错误? [英] GDI+ Generic error on This.Close()?

查看:94
本文介绍了GDI + This.Close()的通用错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好,所以我有一个方法,在其中我无法使用This.close,因为它总是崩溃.该方法的主要操作模块较低.在我的方法内部,所有其他内容主要是对其他方法的声明或调用.有什么想法吗?

Ok, so I have a method inside which I cannot use This.close for it always crashes. The main operational block of the method is lower. Inside my method, all other things are mainly declarations or calls to other methods. Any ideas?

for (int i = 0; i < Metode.DESCHIDERI.Length; i++)
{
    int j = Metode.DESCHIDERI[i];

    p2 = new Point((marginiDeschideri[j * 2].X+marginiDeschideri[j*2+1].X)/2, p1.Y);
    Point pp1 = p1;
    Point pp2 = new Point(p2.X + Convert.ToInt16(LSUPRA), p2.Y);
    if ((pp1.X - pp2.X) > L)
    {
        gbmp.Dispose();
        this.Close();
    }
    else
    {
        gbmp.DrawLine(myPen, pp1, pp2);
        if (s == 0)
            s = 10;
        else
            s = -10;
        p1 = new Point(p2.X - Convert.ToInt16(LSUPRA), p2.Y + s);
    }
}



在我看来,this.close()存在问题,因为它不会停止执行.例如,在调试模式下,我可以清楚地看到它移至this.close(),然后移至下一条指令,就像什么也没有发生.
无论我将this.close()放在此方法或其他方法中的任何地方,都会出现错误.



It seems to me I have a problem with this.close() because it does not stop execution. For instance, under debug mode, I can see it clearly going over to this.close() and then over to the next instructions like nothing happened.
Wherever I put this.close() inside this method, or others, I get the error.

推荐答案

您正在谈论this.Close()和所有但我在您的代码中的任何地方都看不到它.如果您希望人们给您提供优质的遮阳篷,请添加更多代码.

至于gbmp,这是您的图形资料.
You are talking about this.Close() and all but I don''t see it anywhere in your code. Add more code if you want people to give you good awnsers.

As for the gbmp this is your graphics stuff. Are you disposing it correctly before this.close() occurs?


是否在代码中的任何位置(jpg/png/etc)打开任何位图文件?通常是问题导致通用错误的地方.
Do you open any bitmap files anywhere in your code ( jpg/png/etc ) ? That''s usually where a problem causes the generic error.


这篇关于GDI + This.Close()的通用错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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