Commit 8fadbd7d by Neo Turing

优化

parent 2bbb2012
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
this.lbDisplay = new System.Windows.Forms.Label(); this.lbDisplay = new System.Windows.Forms.Label();
this.gbOperating = new System.Windows.Forms.GroupBox(); this.gbOperating = new System.Windows.Forms.GroupBox();
this.btnShot = new System.Windows.Forms.Button(); this.btnShot = new System.Windows.Forms.Button();
this.btnCanon = new System.Windows.Forms.Button();
this.btnEditor = new System.Windows.Forms.Button(); this.btnEditor = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button(); this.btnDelete = new System.Windows.Forms.Button();
this.plLeft.SuspendLayout(); this.plLeft.SuspendLayout();
...@@ -434,6 +435,7 @@ ...@@ -434,6 +435,7 @@
// gbOperating // gbOperating
// //
this.gbOperating.Controls.Add(this.btnShot); this.gbOperating.Controls.Add(this.btnShot);
this.gbOperating.Controls.Add(this.btnCanon);
this.gbOperating.Controls.Add(this.btnEditor); this.gbOperating.Controls.Add(this.btnEditor);
this.gbOperating.Controls.Add(this.btnDelete); this.gbOperating.Controls.Add(this.btnDelete);
this.gbOperating.Dock = System.Windows.Forms.DockStyle.Bottom; this.gbOperating.Dock = System.Windows.Forms.DockStyle.Bottom;
...@@ -452,13 +454,27 @@ ...@@ -452,13 +454,27 @@
this.btnShot.ForeColor = System.Drawing.SystemColors.ControlText; this.btnShot.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnShot.Location = new System.Drawing.Point(3, 17); this.btnShot.Location = new System.Drawing.Point(3, 17);
this.btnShot.Name = "btnShot"; this.btnShot.Name = "btnShot";
this.btnShot.Size = new System.Drawing.Size(343, 59); this.btnShot.Size = new System.Drawing.Size(247, 59);
this.btnShot.TabIndex = 5; this.btnShot.TabIndex = 7;
this.btnShot.Text = "拍照"; this.btnShot.Text = "拍照";
this.btnShot.UseVisualStyleBackColor = false; this.btnShot.UseVisualStyleBackColor = false;
this.btnShot.EnabledChanged += new System.EventHandler(this.btnEnabled_EnabledChanged); this.btnShot.EnabledChanged += new System.EventHandler(this.btnEnabled_EnabledChanged);
this.btnShot.Click += new System.EventHandler(this.btnShot_Click); this.btnShot.Click += new System.EventHandler(this.btnShot_Click);
// //
// btnCanon
//
this.btnCanon.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.btnCanon.Dock = System.Windows.Forms.DockStyle.Right;
this.btnCanon.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCanon.Location = new System.Drawing.Point(250, 17);
this.btnCanon.Name = "btnCanon";
this.btnCanon.Size = new System.Drawing.Size(96, 59);
this.btnCanon.TabIndex = 6;
this.btnCanon.Text = "佳能";
this.btnCanon.UseVisualStyleBackColor = false;
this.btnCanon.EnabledChanged += new System.EventHandler(this.btnEnabled_EnabledChanged);
this.btnCanon.Click += new System.EventHandler(this.btnCanon_Click);
//
// btnEditor // btnEditor
// //
this.btnEditor.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.btnEditor.BackColor = System.Drawing.SystemColors.ButtonHighlight;
...@@ -554,10 +570,11 @@ ...@@ -554,10 +570,11 @@
private System.Windows.Forms.PictureBox ptbPhotoDisplay; private System.Windows.Forms.PictureBox ptbPhotoDisplay;
private System.Windows.Forms.Panel plDisplay; private System.Windows.Forms.Panel plDisplay;
private System.Windows.Forms.Label lbDisplay; private System.Windows.Forms.Label lbDisplay;
private System.Windows.Forms.Button btnShot;
private System.Windows.Forms.Button btnEditor; private System.Windows.Forms.Button btnEditor;
private System.Windows.Forms.Button btnCamearTurn; private System.Windows.Forms.Button btnCamearTurn;
private System.Windows.Forms.ComboBox cbxResolution; private System.Windows.Forms.ComboBox cbxResolution;
private System.Windows.Forms.Button btnCanon;
private System.Windows.Forms.Button btnShot;
} }
} }
...@@ -22,6 +22,7 @@ using System.Threading.Tasks; ...@@ -22,6 +22,7 @@ using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml.Linq; using System.Xml.Linq;
using static System.Net.Mime.MediaTypeNames; using static System.Net.Mime.MediaTypeNames;
using Kivii.Canon;
namespace Kivii.Sample.ImageUploader namespace Kivii.Sample.ImageUploader
{ {
...@@ -37,7 +38,7 @@ namespace Kivii.Sample.ImageUploader ...@@ -37,7 +38,7 @@ namespace Kivii.Sample.ImageUploader
private List<DbFile> photos = new List<DbFile>(); private List<DbFile> photos = new List<DbFile>();
private Report currentReport = null; private Report currentReport = null;
private DbFile currentPhoto = null; private DbFile currentPhoto = null;
private CanonForm canonForm = null;
public FrmMain() public FrmMain()
{ {
...@@ -123,6 +124,7 @@ namespace Kivii.Sample.ImageUploader ...@@ -123,6 +124,7 @@ namespace Kivii.Sample.ImageUploader
btnEditor.Enabled = !notLogin; btnEditor.Enabled = !notLogin;
btnLogout.Enabled = !notLogin; btnLogout.Enabled = !notLogin;
btnCamearTurn.Enabled = !notLogin; btnCamearTurn.Enabled = !notLogin;
btnCanon.Enabled = !notLogin;
if (notLogin) if (notLogin)
{ {
...@@ -970,7 +972,48 @@ namespace Kivii.Sample.ImageUploader ...@@ -970,7 +972,48 @@ namespace Kivii.Sample.ImageUploader
else btnUpload.BackColor = SystemColors.ButtonFace; else btnUpload.BackColor = SystemColors.ButtonFace;
if (btnCamearTurn.Enabled) btnCamearTurn.BackColor = Color.White; if (btnCamearTurn.Enabled) btnCamearTurn.BackColor = Color.White;
else btnCamearTurn.BackColor = SystemColors.ButtonFace; else btnCamearTurn.BackColor = SystemColors.ButtonFace;
if (btnCanon.Enabled) btnCanon.BackColor = Color.White;
else btnCanon.BackColor = SystemColors.ButtonFace;
}
private void btnCanon_Click(object sender, EventArgs e)
{
if (canonForm == null)
{
canonForm = new CanonForm();
canonForm.DownloadCompletely += CanonForm_DownloadCompletely;
}
canonForm.ShowDialog();
}
private void CanonForm_DownloadCompletely(object sender, EventArgs e)
{
var filePath = (string)sender;
if (filePath.IsNullOrEmpty()) return;
if(!File.Exists(filePath)) return;
FileInfo fileInfo = new FileInfo(filePath);
// 捕获当前帧
Bitmap bitmap = System.Drawing.Image.FromFile(filePath) as Bitmap;
if (bitmap == null) return;
var picName = fileInfo.Name;
string reportId = string.Empty;
if (currentReport != null)
{
reportId = currentReport.ReportId;
}
if (!reportId.IsNullOrEmpty())
{
picName = reportId + "_" + picName;
}
//picName += DateTime.Now.ToString("mmssfff");
var photo = new DbFile(bitmap, picName);
addSnapshot(photo);
Thread.Sleep(50);
showSnapshot(photo);
} }
} }
} }
...@@ -46,11 +46,11 @@ ...@@ -46,11 +46,11 @@
<ApplicationIcon>Camera.ico</ApplicationIcon> <ApplicationIcon>Camera.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Kivii.Common.V4.5, Version=5.6.2024.1160, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Common.V4.5, Version=5.6.2024.5200, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Common.5.6.2024.1160\lib\net45\Kivii.Common.V4.5.dll</HintPath> <HintPath>..\..\packages\Kivii.Common.5.6.2024.5200\lib\net45\Kivii.Common.V4.5.dll</HintPath>
</Reference> </Reference>
<Reference Include="Kivii.Core.V4.5, Version=5.6.2023.9000, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Core.V4.5, Version=5.6.2024.5200, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Core.5.6.2023.9000\lib\net45\Kivii.Core.V4.5.dll</HintPath> <HintPath>..\..\packages\Kivii.Core.5.6.2024.5200\lib\net45\Kivii.Core.V4.5.dll</HintPath>
</Reference> </Reference>
<Reference Include="Kivii.Imaging.V4.0, Version=5.6.2021.3000, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Imaging.V4.0, Version=5.6.2021.3000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Imaging.5.6.2021.3000\lib\net\Kivii.Imaging.V4.0.dll</HintPath> <HintPath>..\..\packages\Kivii.Imaging.5.6.2021.3000\lib\net\Kivii.Imaging.V4.0.dll</HintPath>
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
<Reference Include="Kivii.Linq.Sqlite.V4.5, Version=5.6.2023.3000, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Linq.Sqlite.V4.5, Version=5.6.2023.3000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Linq.Sqlite.5.6.2023.3000\lib\net45\Kivii.Linq.Sqlite.V4.5.dll</HintPath> <HintPath>..\..\packages\Kivii.Linq.Sqlite.5.6.2023.3000\lib\net45\Kivii.Linq.Sqlite.V4.5.dll</HintPath>
</Reference> </Reference>
<Reference Include="Kivii.Linq.V4.5, Version=5.6.2024.2000, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Linq.V4.5, Version=5.6.2024.5200, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Linq.5.6.2024.2000\lib\net45\Kivii.Linq.V4.5.dll</HintPath> <HintPath>..\..\packages\Kivii.Linq.5.6.2024.5200\lib\net45\Kivii.Linq.V4.5.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
...@@ -135,5 +135,11 @@ ...@@ -135,5 +135,11 @@
<ItemGroup> <ItemGroup>
<Content Include="Camera.ico" /> <Content Include="Camera.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Kivii.Client.Canon\Src\Kivii.Client.Canon.V4.5.csproj">
<Project>{08fa5081-59f1-4e6a-b44c-309ef67159e6}</Project>
<Name>Kivii.Client.Canon.V4.5</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Kivii.Common" version="5.6.2024.1160" targetFramework="net45" /> <package id="Kivii.Common" version="5.6.2024.5200" targetFramework="net45" />
<package id="Kivii.Core" version="5.6.2023.9000" targetFramework="net45" /> <package id="Kivii.Core" version="5.6.2024.5200" targetFramework="net45" />
<package id="Kivii.Imaging" version="5.6.2021.3000" targetFramework="net45" /> <package id="Kivii.Imaging" version="5.6.2021.3000" targetFramework="net45" />
<package id="Kivii.Linq" version="5.6.2024.2000" targetFramework="net45" /> <package id="Kivii.Linq" version="5.6.2024.5200" targetFramework="net45" />
<package id="Kivii.Linq.Sqlite" version="5.6.2023.3000" targetFramework="net45" /> <package id="Kivii.Linq.Sqlite" version="5.6.2023.3000" targetFramework="net45" />
</packages> </packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment