void searchAlertInfo()
{
searchAlertTable.Rows.Clear();
DataTable tempTable = AlertConsoleBiz.SearchAlertInfo(maxSearchAlertNum, this.ddtpStartTime.Value, this.ddtpEndTime.Value, searchDspID).Tables[0];
DataRow dr = null;
Image imgSnap1 = null;
Image imgSnap2 = null;
MemoryStream ms1 = null;
MemoryStream ms2 = null;
int alertCount = 0;
if (tempTable.Rows.Count >= this.maxSearchAlertNum)
{
alertCount = maxSearchAlertNum;
}
else
{
alertCount = tempTable.Rows.Count;
}
Invoke(SetTspMaxDelegate, new object[] { alertCount });
for (int i = 0; i < alertCount; i++)
{
Invoke(TspPerformStepDelegate,null);
try
{
ms1 = new MemoryStream((byte[])dr[7]);
imgSnap1 = Image.FromStream(ms1);
ms2 = new MemoryStream((byte[])dr[8]);
imgSnap2 = Image.FromStream(ms2);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
byte[] image1 = (byte[])dr[7];
byte[] image2 = (byte[])dr[8];
//给图片添加规则信息,画线,画图
//画DSP端传过来的矩形
Invoke(bindDataSourceDelegate, new object[] { dgvSearchAlert, searchAlertTable });
Invoke(TspPerformStepDelegate, null);
Invoke(ResizeDataGridViewDelegate, new object[] { dgvSearchAlert, i });
}//end of for loop
ms1.Close();
ms2.Close();
Invoke(FinishSearchDelegate,alertCount);
}
以上是我的查询代码,当分辨率为:1024*768时就好使,没问题,如果分辨率该为1028*768时候,查询就出现死机,就是在查询显示图片时死了,请高手指教
{
searchAlertTable.Rows.Clear();
DataTable tempTable = AlertConsoleBiz.SearchAlertInfo(maxSearchAlertNum, this.ddtpStartTime.Value, this.ddtpEndTime.Value, searchDspID).Tables[0];
DataRow dr = null;
Image imgSnap1 = null;
Image imgSnap2 = null;
MemoryStream ms1 = null;
MemoryStream ms2 = null;
int alertCount = 0;
if (tempTable.Rows.Count >= this.maxSearchAlertNum)
{
alertCount = maxSearchAlertNum;
}
else
{
alertCount = tempTable.Rows.Count;
}
Invoke(SetTspMaxDelegate, new object[] { alertCount });
for (int i = 0; i < alertCount; i++)
{
Invoke(TspPerformStepDelegate,null);
try
{
ms1 = new MemoryStream((byte[])dr[7]);
imgSnap1 = Image.FromStream(ms1);
ms2 = new MemoryStream((byte[])dr[8]);
imgSnap2 = Image.FromStream(ms2);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
byte[] image1 = (byte[])dr[7];
byte[] image2 = (byte[])dr[8];
//给图片添加规则信息,画线,画图
//画DSP端传过来的矩形
Invoke(bindDataSourceDelegate, new object[] { dgvSearchAlert, searchAlertTable });
Invoke(TspPerformStepDelegate, null);
Invoke(ResizeDataGridViewDelegate, new object[] { dgvSearchAlert, i });
}//end of for loop
ms1.Close();
ms2.Close();
Invoke(FinishSearchDelegate,alertCount);
}
以上是我的查询代码,当分辨率为:1024*768时就好使,没问题,如果分辨率该为1028*768时候,查询就出现死机,就是在查询显示图片时死了,请高手指教
解决方案 »
- c#如何显示16位灰度图像
- 为什么我的二级联动实现不了?大家帮忙啊!
- 检索COM类工厂中CLSID为{1F79A08F-62B2-4841-96B2-F9A21267BD7C}的组件时失败原因是出现以下错误:8007007e
- 怎么实现像QQ聊天窗口的发送按钮下拉菜单?
- datagridview,增加新的数据后,一定要把窗体关了,重新打开才能显示刚刚新加的数据
- 将数据从托管对象封送到非托管内存块的问题,请各位高手赐教啊!
- 将listviewItem的backcolor设置KnownColor.activeCaption不成功:(
- Grid上多选后,右键编辑,删除问题
- 关于模拟登陆网站,高分求取(在线等...)
- 关于this.btnClose.Click += new System.EventHandler(this.btnClose_Click)
- 面试题如何防止sql注入式攻击
- C# 串口处理
不是thread的问题,因为根据你说的"当分辨率为:1024*768时就好使,没问题",所以因为是你之前调试的时候出现些问题!
祝:
楼主成功!