Commit afe304fc 顾剑亮

点料更新

1 个父辈 4168a13d
正在显示 31 个修改的文件 包含 56 行增加23 行删除
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Asa.CarerayImage.xml</DocumentationFile> <DocumentationFile>bin\Debug\Asa.CarerayImage.xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -50,5 +50,19 @@ ...@@ -50,5 +50,19 @@
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="bin\Debug\Asa.CarerayImage.dll" />
<Content Include="bin\Debug\Asa.CarerayImage.pdb" />
<Content Include="bin\Debug\Asa.CarerayImage.xml" />
<Content Include="bin\Debug\CRCallback.dll" />
<Content Include="bin\Debug\CRInterface.dll" />
<Content Include="bin\Debug\log4net.dll" />
</ItemGroup>
<ItemGroup>
<None Include="bin\Debug\CRCallback.lib" />
</ItemGroup>
<ItemGroup>
<Folder Include="bin\Release\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file \ No newline at end of file
...@@ -191,7 +191,7 @@ namespace Asa ...@@ -191,7 +191,7 @@ namespace Asa
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
short point = BitConverter.ToInt16(gray, idx1); short point = BitConverter.ToInt16(gray, idx1);
if (point > 32767) point = 32767; point += 20000;
if (point < WindowLevel - half) if (point < WindowLevel - half)
{ {
...@@ -204,21 +204,28 @@ namespace Asa ...@@ -204,21 +204,28 @@ namespace Asa
} }
else if (point > WindowLevel + half) else if (point > WindowLevel + half)
{ {
//buff[idx2++] = 255;
//buff[idx2++] = 127;
//buff[idx2++] = 255;
//buff[idx2++] = 127;
//buff[idx2++] = 255;
//buff[idx2++] = 127;
buff[idx2++] = 255;
buff[idx2++] = 255;
buff[idx2++] = 255;
buff[idx2++] = 255; buff[idx2++] = 255;
buff[idx2++] = 127;
buff[idx2++] = 255; buff[idx2++] = 255;
buff[idx2++] = 127;
buff[idx2++] = 255; buff[idx2++] = 255;
buff[idx2++] = 127;
} }
else else
{ {
buff[idx2++] = gray[idx1]; byte[] bb = BitConverter.GetBytes(point);
buff[idx2++] = gray[idx1 + 1]; buff[idx2++] = bb[0];
buff[idx2++] = gray[idx1]; buff[idx2++] = bb[1];
buff[idx2++] = gray[idx1 + 1]; buff[idx2++] = bb[0];
buff[idx2++] = gray[idx1]; buff[idx2++] = bb[1];
buff[idx2++] = gray[idx1 + 1]; buff[idx2++] = bb[0];
buff[idx2++] = bb[1];
} }
idx1 += 2; idx1 += 2;
} }
......
f1f9c56bb7e07e8ee867fbe9a762cde9bc21bb47 f6c12c9e44f3bc97ecd1e5730e2b6df4a3629749
...@@ -11,6 +11,5 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\C ...@@ -11,6 +11,5 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\C
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csproj.CoreCompileInputs.cache D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\Asa.CarerayImage.dll D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\Asa.CarerayImage.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\Asa.CarerayImage.pdb D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\Asa.CarerayImage.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csproj.CopyComplete D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csprojAssemblyReference.cache D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csprojAssemblyReference.cache
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
this.pictureBox1.Location = new System.Drawing.Point(115, 12); this.pictureBox1.Location = new System.Drawing.Point(115, 12);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(673, 426); this.pictureBox1.Size = new System.Drawing.Size(673, 426);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 1; this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
......
...@@ -70,11 +70,12 @@ namespace CarerayImage_Test ...@@ -70,11 +70,12 @@ namespace CarerayImage_Test
bmp = careray.Get48bImage(); bmp = careray.Get48bImage();
pictureBox1.Image = bmp; pictureBox1.Image = bmp;
} }
private void button5_Click(object sender, EventArgs e) private void button5_Click(object sender, EventArgs e)
{ {
bmp.Save(Application.StartupPath + string.Format("\\{0:HHmmss}", DateTime.Now) + ".png", System.Drawing.Imaging.ImageFormat.Png); bmp.Save(Application.StartupPath + string.Format("\\png\\{0:HHmmss}", DateTime.Now) + ".png", System.Drawing.Imaging.ImageFormat.Png);
} }
...@@ -84,9 +85,9 @@ namespace CarerayImage_Test ...@@ -84,9 +85,9 @@ namespace CarerayImage_Test
int h = 100; int h = 100;
int count = w * h; int count = w * h;
byte[] buff = new byte[count * 3 * 2]; byte[] buff = new byte[count * 4 * 2];
int n = 0; int n = 0;
int color = 32767; int color = 65535;
byte[] bb = BitConverter.GetBytes(color); byte[] bb = BitConverter.GetBytes(color);
...@@ -100,11 +101,11 @@ namespace CarerayImage_Test ...@@ -100,11 +101,11 @@ namespace CarerayImage_Test
buff[n++] = bb[1]; buff[n++] = bb[1];
} }
Bitmap bmp1 = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format48bppRgb); bmp = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format48bppRgb);
System.Drawing.Imaging.BitmapData bmpData = bmp1.LockBits(new Rectangle(0, 0, w, h), System.Drawing.Imaging.ImageLockMode.ReadWrite, bmp1.PixelFormat); System.Drawing.Imaging.BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, w, h), System.Drawing.Imaging.ImageLockMode.ReadWrite, bmp.PixelFormat);
System.Runtime.InteropServices.Marshal.Copy(buff, 0, bmpData.Scan0, bmpData.Stride * h); System.Runtime.InteropServices.Marshal.Copy(buff, 0, bmpData.Scan0, bmpData.Stride * h);
bmp1.UnlockBits(bmpData); bmp.UnlockBits(bmpData);
pictureBox1.Image = bmp1; pictureBox1.Image = bmp;
} }
} }
} }
...@@ -46,8 +46,18 @@ namespace Asa ...@@ -46,8 +46,18 @@ namespace Asa
private void RunCmd() private void RunCmd()
{ {
_count = "0";
Process p = new Process(); Process p = new Process();
p.StartInfo.FileName = Environment.CurrentDirectory+ "\\count\\count_nocolor.exe"; string s1 = Environment.CurrentDirectory + "\\count_nocolor\\count_nocolor.exe";
string s2 = Environment.CurrentDirectory + "\\count\\count.exe";
if (System.IO.File.Exists(s1))
p.StartInfo.FileName = s1;
else if (System.IO.File.Exists(s2))
p.StartInfo.FileName = s2;
else
return;
//p.StartInfo.FileName = Environment.CurrentDirectory+ "\\count\\count_nocolor.exe";
p.StartInfo.Arguments = string.Format("{0} {1} {2}", _path1, _path2, _path3); p.StartInfo.Arguments = string.Format("{0} {1} {2}", _path1, _path2, _path3);
p.StartInfo.UseShellExecute = false; //是否使用操作系统shell启动 p.StartInfo.UseShellExecute = false; //是否使用操作系统shell启动
p.StartInfo.RedirectStandardInput = true; //接受来自调用程序的输入信息 p.StartInfo.RedirectStandardInput = true; //接受来自调用程序的输入信息
......
...@@ -12,3 +12,4 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controll ...@@ -12,3 +12,4 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controller\X-Ray Controller\obj\Debug\X-Ray.pdb D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controller\X-Ray Controller\obj\Debug\X-Ray.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controller\X-Ray Controller\bin\Debug\log4net.dll D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controller\X-Ray Controller\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controller\X-Ray Controller\obj\Debug\X-Ray Controller.csproj.CopyComplete D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controller\X-Ray Controller\obj\Debug\X-Ray Controller.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\X-Ray Controller\X-Ray Controller\obj\Debug\X-Ray Controller.csprojAssemblyReference.cache
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
this.textBox2.Name = "textBox2"; this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 21); this.textBox2.Size = new System.Drawing.Size(100, 21);
this.textBox2.TabIndex = 10; this.textBox2.TabIndex = 10;
this.textBox2.Text = "60.0"; this.textBox2.Text = "060.0";
// //
// textBox3 // textBox3
// //
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
this.textBox3.Name = "textBox3"; this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(100, 21); this.textBox3.Size = new System.Drawing.Size(100, 21);
this.textBox3.TabIndex = 11; this.textBox3.TabIndex = 11;
this.textBox3.Text = "500"; this.textBox3.Text = "0500";
// //
// Form1 // Form1
// //
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!