Commit 200cea5e LN

参数修改

1 个父辈 5c989fcf
...@@ -154,11 +154,11 @@ namespace CodeLibrary ...@@ -154,11 +154,11 @@ namespace CodeLibrary
stopwatch.Restart(); stopwatch.Restart();
HDCodeHelper.HalconWindow = this.hWindowControl1.HalconWindow; HDCodeHelper.HalconWindow = this.hWindowControl1.HalconWindow;
Bitmap map = new Bitmap(pictureBox1.Image); Bitmap map = new Bitmap(pictureBox1.Image);
if (chbZxing.Checked) //if (chbZxing.Checked)
{ //{
zxingDecode(map, "barcode"); // zxingDecode(map, "barcode");
} //}
else //else
{ {
List<CodeInfo> result = HDCodeHelper.DecodeBarCode(map); List<CodeInfo> result = HDCodeHelper.DecodeBarCode(map);
ShowCode(result); ShowCode(result);
...@@ -206,11 +206,11 @@ namespace CodeLibrary ...@@ -206,11 +206,11 @@ namespace CodeLibrary
{ {
codeParamPath = ""; codeParamPath = "";
} }
if (chbZxing.Checked) //if (chbZxing.Checked)
{ //{
zxingDecode(map, cmbCodeType.Text); // zxingDecode(map, cmbCodeType.Text);
} //}
else //else
{ {
List<CodeInfo> codeList = new List<CodeInfo>(); List<CodeInfo> codeList = new List<CodeInfo>();
if (cmbCodeType.Text.ToLower().Equals("barcode")) if (cmbCodeType.Text.ToLower().Equals("barcode"))
...@@ -235,14 +235,14 @@ namespace CodeLibrary ...@@ -235,14 +235,14 @@ namespace CodeLibrary
} }
private void zxingDecode(Bitmap map,string type ) private void zxingDecode(Bitmap map,string type )
{ {
List<string> results = ZXingCodeHelper.DeCodes(map, type); //List<string> results = ZXingCodeHelper.DeCodes(map, type);
txtResult.Text = " zxing decode:"; //txtResult.Text = " zxing decode:";
foreach (string code in results) //foreach (string code in results)
{ //{
txtResult.Text += "\r\n" + "\r\n" + code; // txtResult.Text += "\r\n" + "\r\n" + code;
} //}
txtResult.Text += "\r\n \r\n elapsed time:" + stopwatch.Elapsed.ToString(); //txtResult.Text += "\r\n \r\n elapsed time:" + stopwatch.Elapsed.ToString();
} }
private void btnClearLog_Click(object sender, EventArgs e) private void btnClearLog_Click(object sender, EventArgs e)
......
...@@ -200,7 +200,7 @@ namespace CodeLibrary ...@@ -200,7 +200,7 @@ namespace CodeLibrary
ho_Image.Dispose(); ho_Image.Dispose();
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height); Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
BitmapData srcBmpData = bmp.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppRgb); BitmapData srcBmpData = bmp.LockBits(rect, ImageLockMode.ReadOnly, bmp.PixelFormat);
HOperatorSet.GenImageInterleaved(out ho_Image, srcBmpData.Scan0, "bgrx", bmp.Width, bmp.Height, 0, "byte", 0, 0, 0, 0, -1, 0); HOperatorSet.GenImageInterleaved(out ho_Image, srcBmpData.Scan0, "bgrx", bmp.Width, bmp.Height, 0, "byte", 0, 0, 0, 0, -1, 0);
bmp.UnlockBits(srcBmpData); bmp.UnlockBits(srcBmpData);
......
...@@ -145,7 +145,7 @@ namespace CodeLibrary ...@@ -145,7 +145,7 @@ namespace CodeLibrary
int rtn = cameraCurr[index].MV_CC_StartGrabbing_NET(); int rtn = cameraCurr[index].MV_CC_StartGrabbing_NET();
if (rtn != MyCamera.MV_OK) if (rtn != MyCamera.MV_OK)
{ {
_errInfo = "Can not grab one"; _errInfo = "Can not grab one : "+ rtn;
return null; return null;
} }
return ImageCapture(index); return ImageCapture(index);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!