执行程序后直接退出 [英] after executing program it get out directly

查看:84
本文介绍了执行程序后直接退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行程序后,它直接脱离项目.我不知道为什么会发生.

After executing program it gets directly out side of project. I don''t know why it happens.

for (int i = 1; i != POINTS_ON_CURVE-1; i += 2)
{
  g.DrawRectangle(newpx, new Rectangle((int)p[i + 1], (int)p[i], 1, 1));
  g.Flush();
  Application.DoEvents();
}



执行后下车.

请帮我.

从下面的评论中添加:



After executing it gets off.

Plz help me.

Added from comment below:

ptList.Add(162); 
ptList.Add(127); 
ptList.Add(204); 
ptList.Add(124); 
ptList.Add(304); 
ptList.Add(207); // how many points do you need on the curve? 
const int POINTS_ON_CURVE = 1000; 
double[] ptind = new double[ptList.Count]; 
double[] p = new double[POINTS_ON_CURVE]; 
ptList.CopyTo(ptind, 0); 
bc.Bezier2D(ptind, (POINTS_ON_CURVE) / 2, p); 
//pictureBox1.Refresh(); 
// draw points 
for (int i = 1; i != POINTS_ON_CURVE - 1; i += 2) 
{ 
  g.DrawRectangle(newpx, new Rectangle((int)p[i + 1], (int)p[i], 1, 1)); 
  g.Flush(); 
  Application.DoEvents(); 
}



它是一个用于在我执行时绘制曲线的程序,它可以正确执行,但是在绘制曲线后,它直接关闭窗口



it is a program for drawing a curve when i go to execute it executes correctly but after drawing a curve it directly close the window

推荐答案

Application.DoEvents已经告诉我你做错了什么.是在OnPaint内部还是Point事件的处理程序中?您从哪里获得g?您似乎不知道如何正确渲染图形并进行更改.

首先,使用Debugger看看发生了什么.

另请参阅我的评论.如果您对问题的解释太草率,我无能为力.您也没有显示足够的代码.

—SA
You Application.DoEvents already tells me you''re doing something wrong. Is it inside OnPaint or handler of the Point event? Where did you get g? It looks like you have no idea on how to render graphics correctly and change it.

First of all, use Debugger to see what''s going on.

See also my comment. I cannot help you if your explanation of the problem is so sloppy. You also don''t show enough code.

—SA


这篇关于执行程序后直接退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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