Skip to content

Commit be08c74

Browse files
committed
alpha 0.7预览版bug修复 2018年9月10日
1 parent ec7d068 commit be08c74

File tree

7 files changed

+124
-46
lines changed

7 files changed

+124
-46
lines changed

LearnOpenCVEdu/FrmFunctions/FrmHistogram.Designer.cs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LearnOpenCVEdu/FrmMain.Designer.cs

Lines changed: 48 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LearnOpenCVEdu/FrmMain.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,6 @@ private void MenuHistogram_Click(object sender, EventArgs e)
11391139
}
11401140
#endregion
11411141

1142-
11431142
#region 菜单:帮助
11441143
/// <summary>
11451144
/// 关于
@@ -1151,7 +1150,6 @@ private void MenuAbout_Click(object sender, EventArgs e)
11511150
}
11521151
#endregion
11531152

1154-
11551153
/// <summary>
11561154
/// 更新界面的显示与否、可用与否状态
11571155
/// </summary>
@@ -1161,7 +1159,7 @@ private void CheckEnableVisible_Status()
11611159
MenuThreshold.Enabled = MenuGeometric.Enabled = MenuDrawingFunction.Enabled =
11621160
MenuBlur.Enabled = MenuShowProperties.Enabled = MenuHistogram.Enabled =
11631161
MenuMorphology.Enabled = MenuCannyEdge.Enabled = MenuContoursFeatures.Enabled =
1164-
MenuHoughTransform.Enabled = MenuSaveCurrent.Enabled = ConstantFlags.IS_ORIGIN_IMAGE_OPENED;
1162+
MenuHoughTransform.Enabled = MenuSaveCurrent.Enabled = MenuSplitChannels.Enabled = ConstantFlags.IS_ORIGIN_IMAGE_OPENED;
11651163

11661164
//历史图片的右键菜单
11671165
MenuShowAlone.Enabled = MenuBeMain.Enabled = MenuRemove.Enabled = MenuSaveHistory.Enabled = ConstantFlags.IS_PIC_HISTORY_SELECTED;
@@ -1282,17 +1280,6 @@ private bool IsExists(string windowName)
12821280
return false;
12831281
}
12841282

1285-
/// <summary>
1286-
/// 检查相比原图,是否做了更改
1287-
/// </summary>
1288-
private void CheckImageUpdates()
1289-
{
1290-
if (mCurrentImage != mOriginImage)
1291-
{
1292-
MessageBox.Show("图片已更改");
1293-
}
1294-
}
1295-
12961283
/// <summary>
12971284
/// 添加历史图像
12981285
/// </summary>

LearnOpenCVEdu/LearnOpenCVEdu.csproj

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,27 @@
88
<ProjectGuid>{5B260940-BF29-41AC-B02A-1027DD214000}</ProjectGuid>
99
<OutputType>WinExe</OutputType>
1010
<RootNamespace>LearnOpenCVEdu</RootNamespace>
11-
<AssemblyName>LearnOpenCVEdu</AssemblyName>
11+
<AssemblyName>学习图像处理(OpenCV)教学版</AssemblyName>
1212
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1515
<NuGetPackageImportStamp>
1616
</NuGetPackageImportStamp>
17+
<PublishUrl>publish\</PublishUrl>
18+
<Install>true</Install>
19+
<InstallFrom>Disk</InstallFrom>
20+
<UpdateEnabled>false</UpdateEnabled>
21+
<UpdateMode>Foreground</UpdateMode>
22+
<UpdateInterval>7</UpdateInterval>
23+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
24+
<UpdatePeriodically>false</UpdatePeriodically>
25+
<UpdateRequired>false</UpdateRequired>
26+
<MapFileExtensions>true</MapFileExtensions>
27+
<ApplicationRevision>0</ApplicationRevision>
28+
<ApplicationVersion>0.7.0.%2a</ApplicationVersion>
29+
<IsWebBootstrapper>false</IsWebBootstrapper>
30+
<UseApplicationTrust>false</UseApplicationTrust>
31+
<BootstrapperEnabled>true</BootstrapperEnabled>
1732
</PropertyGroup>
1833
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1934
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -34,6 +49,9 @@
3449
<ErrorReport>prompt</ErrorReport>
3550
<WarningLevel>4</WarningLevel>
3651
</PropertyGroup>
52+
<PropertyGroup>
53+
<ApplicationIcon>logo.ico</ApplicationIcon>
54+
</PropertyGroup>
3755
<ItemGroup>
3856
<Reference Include="Emgu.CV.UI, Version=3.1.0.2282, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL">
3957
<HintPath>..\packages\EmguCV.3.1.0.1\lib\net30\Emgu.CV.UI.dll</HintPath>
@@ -326,6 +344,21 @@
326344
<ItemGroup>
327345
<None Include="resources\logo.ico" />
328346
</ItemGroup>
347+
<ItemGroup>
348+
<Content Include="logo.ico" />
349+
</ItemGroup>
350+
<ItemGroup>
351+
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
352+
<Visible>False</Visible>
353+
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 和 x64%29</ProductName>
354+
<Install>true</Install>
355+
</BootstrapperPackage>
356+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
357+
<Visible>False</Visible>
358+
<ProductName>.NET Framework 3.5 SP1</ProductName>
359+
<Install>false</Install>
360+
</BootstrapperPackage>
361+
</ItemGroup>
329362
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
330363
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
331364
<PropertyGroup>

LearnOpenCVEdu/Program.cs

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
2+
using System.Diagnostics;
3+
using System.Reflection;
4+
using System.Security.Principal;
55
using System.Windows.Forms;
66

77
namespace LearnOpenCVEdu
@@ -14,9 +14,41 @@ static class Program
1414
[STAThread]
1515
static void Main()
1616
{
17+
CheckAdmin();
18+
1719
Application.EnableVisualStyles();
1820
Application.SetCompatibleTextRenderingDefault(false);
1921
Application.Run(new FrmMain());
2022
}
23+
24+
/// <summary>
25+
/// 开机检查是否以管理员身份运行
26+
/// </summary>
27+
private static void CheckAdmin()
28+
{
29+
var wi = WindowsIdentity.GetCurrent();
30+
var wp = new WindowsPrincipal(wi);
31+
32+
bool runAsAdmin = wp.IsInRole(WindowsBuiltInRole.Administrator);
33+
34+
if (!runAsAdmin)
35+
{
36+
var processInfo = new ProcessStartInfo(Assembly.GetExecutingAssembly().CodeBase);
37+
38+
processInfo.UseShellExecute = true;
39+
processInfo.Verb = "runas";
40+
41+
try
42+
{
43+
Process.Start(processInfo);
44+
}
45+
catch (Exception)
46+
{
47+
//MessageBox.Show(ex.Message);
48+
}
49+
50+
Environment.Exit(0);
51+
}
52+
}
2153
}
2254
}

LearnOpenCVEdu/Properties/AssemblyInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
[assembly: AssemblyTitle("LearnOpenCVEdu")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyCompany("ex2tron")]
1212
[assembly: AssemblyProduct("LearnOpenCVEdu")]
1313
[assembly: AssemblyCopyright("Copyright © 2018")]
14-
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyTrademark("ex2tron")]
1515
[assembly: AssemblyCulture("")]
1616

1717
// 将 ComVisible 设置为 false 会使此程序集中的类型
@@ -32,5 +32,5 @@
3232
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
3333
// 方法是按如下所示使用“*”: :
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("0.7.0.0")]
36+
[assembly: AssemblyFileVersion("0.7.0.0")]

LearnOpenCVEdu/logo.ico

422 KB
Binary file not shown.

0 commit comments

Comments
 (0)