Commit f8150914 by Tapio Haapala

Uusi moya signup

1 parent 9595c474
Showing with 4082 additions and 248 deletions
......@@ -61,6 +61,8 @@ namespace MoyaAdminLib
ContentType = "application/json";
PostData = postData;
}
public static string CalculateSHA1(string text)
{
// Convert the input string to a byte array
......@@ -87,21 +89,41 @@ namespace MoyaAdminLib
return (int)span.TotalSeconds;
}
public static string GetRequestURL(string server, string parameters)
public static string GetRequestURL(string server, string queryPath)
{
return GetRequestURL(server, queryPath,null);
}
public static string GetRequestURL(string server, string queryPath, string getparms)
{
int timestamp = ConvertToTimestamp(DateTime.Now);
string hash = CalculateSHA1("/" + parameters + "+" + ApiApplicationKey + "+" + ApiUser + "+" + timestamp + "+" + ApiPass);
string url = server + "/rest/" + parameters + "?appkey=" + ApiApplicationKey + "&appuser=" + ApiUser + "&appstamp=" + timestamp + "&appmac=" + hash;
string hash = CalculateSHA1("/" + queryPath + "+" + ApiApplicationKey + "+" + ApiUser + "+" + timestamp + "+" + ApiPass);
if (getparms != null && getparms.Length > 0)
getparms = getparms + "&";
string url = server + "/rest/" + queryPath + "?";
if (getparms != null)
url += getparms;
url += "appkey=" + ApiApplicationKey + "&appuser=" + ApiUser + "&appstamp=" + timestamp + "&appmac=" + hash;
Console.WriteLine(url);
return url;
}
public string MakeRequest(string parameters)
public string MakeRequest(string queryPath)
{
return MakeRequest(queryPath, null);
}
public string MakeRequest(string queryPath, string getparms)
{
///placeadmin/places/30+abcdefg+testuser-asdf+1393735570144+acdcabbacd
///
var request = (HttpWebRequest)WebRequest.Create(GetRequestURL(EndPoint,parameters));
var request = (HttpWebRequest)WebRequest.Create(GetRequestURL(EndPoint,queryPath,getparms));
request.Method = Method.ToString();
......@@ -151,7 +173,8 @@ namespace MoyaAdminLib
}
catch (WebException e)
{
if (e.Status == WebExceptionStatus.ConnectFailure)
throw e;
Stream responseStream = ((WebException)e).Response.GetResponseStream();
if (responseStream != null)
......
......@@ -15,7 +15,10 @@ namespace MoyaAdminLib
{
APIreference = user;
}
public User()
{
APIreference = new Eventuser();
}
private Eventuser APIreference;
public Eventuser APIReference
{
......@@ -28,11 +31,13 @@ namespace MoyaAdminLib
{
get { return APIreference.eventuserId; }
}
/*
/// <summary>
/// User global id. Usual you want event user id!
/// </summary>
public int UserId
{
get { return APIreference.userId; }
}*/
}
public string Nick
{
......@@ -54,10 +59,44 @@ namespace MoyaAdminLib
get { return APIreference.login; }
}
public string Birthday
{
get {return APIreference.birthday;}
}
//MALE FEMALE UNDEFINED
public string Gender
{
get {return APIreference.gender;}
}
public string Email;
public string PhoneNumber
{
get {return APIreference.phoneNumber;}
}
public string StreetAddress
{
get { return APIreference.streetAddress; }
}
public string ZipCode
{
get { return APIreference.zipCode; }
}
public string postOffice
{
get { return APIreference.postOffice; }
}
public override string ToString()
{
return this.Firstname + " "+ Lastname;
return this.Firstname + " " + Lastname;
}
public static List<User> Cache = new List<User>();
public static void LoadAll()
......
......@@ -7,6 +7,20 @@ using System.Threading.Tasks;
namespace MoyaAdminLib
{
//"eventuserId":7019,"firstname":"Topi","lastname":"Kinnunen","login":"xxtopotxx","userId":4902,"nick":"xXtopotXx"},
/* {
"nick": "jkj",
"login": "jkj",
"eventuserId": 7913,
"userId": 219,
"firstname": "Juho",
"lastname": "Juopperi",
"birthday": "1984-08-02T00:00:00+03:00",
"gender": "MALE",
"phoneNumber": "+358405422321",
"streetAddress": "Kaitoväylä 14 A 1",
"zipCode": "90571",
"postOffice": ""
}*/
public class Eventuser
{
public int eventuserId;
......@@ -15,6 +29,12 @@ namespace MoyaAdminLib
public string login;
public int userId;
public string nick;
public string birthday;
public string gender;
public string phoneNumber;
public string streetAddress;
public string zipCode;
public string postOffice;
}
}
......@@ -20,3 +20,4 @@ D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Debug\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Debug\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.csprojResolveAssemblyReference.cache
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Release\MoyaAdminLib.dll.config
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Release\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Release\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.Controls.EventUserEditor.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.csproj.GenerateResource.Cache
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.csprojResolveAssemblyReference.cache

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminUI", "MoyaAdminUI\MoyaAdminUI.csproj", "{56D4C2A6-B4A2-4E40-ACFB-19E188AAD703}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminLib", "MoyaAdminLib\MoyaAdminLib.csproj", "{095CE28F-5B53-4203-85C6-3A9AFD486407}"
......
......@@ -51,6 +51,10 @@
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.orgMealToolStripButton = new System.Windows.Forms.ToolStripButton();
this.TopPanel = new System.Windows.Forms.Panel();
this.freePlacesCountTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.reservedPlacesCountTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.MapsComboBox = new System.Windows.Forms.ComboBox();
this.searchTextBox = new System.Windows.Forms.TextBox();
......@@ -58,10 +62,6 @@
this.searchTimer = new System.Windows.Forms.Timer(this.components);
this.ImageRefreshTimer = new System.Windows.Forms.Timer(this.components);
this.panel2 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.reservedPlacesCountTextBox = new System.Windows.Forms.TextBox();
this.freePlacesCountTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.placesCountTimer = new System.Windows.Forms.Timer(this.components);
((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).BeginInit();
this.toolStrip1.SuspendLayout();
......@@ -73,7 +73,8 @@
// placesContextMenuStrip
//
this.placesContextMenuStrip.Name = "placesContextMenuStrip";
this.placesContextMenuStrip.Size = new System.Drawing.Size(61, 4);
this.placesContextMenuStrip.Size = new System.Drawing.Size(153, 26);
this.placesContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.placesContextMenuStrip_Opening);
//
// MapPictureBox
//
......@@ -282,6 +283,40 @@
this.TopPanel.Size = new System.Drawing.Size(752, 45);
this.TopPanel.TabIndex = 15;
//
// freePlacesCountTextBox
//
this.freePlacesCountTextBox.Location = new System.Drawing.Point(418, 18);
this.freePlacesCountTextBox.Name = "freePlacesCountTextBox";
this.freePlacesCountTextBox.ReadOnly = true;
this.freePlacesCountTextBox.Size = new System.Drawing.Size(100, 20);
this.freePlacesCountTextBox.TabIndex = 10;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(362, 21);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(50, 13);
this.label2.TabIndex = 9;
this.label2.Text = "Vapaana";
//
// reservedPlacesCountTextBox
//
this.reservedPlacesCountTextBox.Location = new System.Drawing.Point(251, 18);
this.reservedPlacesCountTextBox.Name = "reservedPlacesCountTextBox";
this.reservedPlacesCountTextBox.ReadOnly = true;
this.reservedPlacesCountTextBox.Size = new System.Drawing.Size(100, 20);
this.reservedPlacesCountTextBox.TabIndex = 8;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(204, 21);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 13);
this.label1.TabIndex = 7;
this.label1.Text = "Varattu";
//
// label3
//
this.label3.AutoSize = true;
......@@ -341,40 +376,6 @@
this.panel2.Size = new System.Drawing.Size(752, 471);
this.panel2.TabIndex = 17;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(204, 21);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 13);
this.label1.TabIndex = 7;
this.label1.Text = "Varattu";
//
// reservedPlacesCountTextBox
//
this.reservedPlacesCountTextBox.Location = new System.Drawing.Point(251, 18);
this.reservedPlacesCountTextBox.Name = "reservedPlacesCountTextBox";
this.reservedPlacesCountTextBox.ReadOnly = true;
this.reservedPlacesCountTextBox.Size = new System.Drawing.Size(100, 20);
this.reservedPlacesCountTextBox.TabIndex = 8;
//
// freePlacesCountTextBox
//
this.freePlacesCountTextBox.Location = new System.Drawing.Point(418, 18);
this.freePlacesCountTextBox.Name = "freePlacesCountTextBox";
this.freePlacesCountTextBox.ReadOnly = true;
this.freePlacesCountTextBox.Size = new System.Drawing.Size(100, 20);
this.freePlacesCountTextBox.TabIndex = 10;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(362, 21);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(50, 13);
this.label2.TabIndex = 9;
this.label2.Text = "Vapaana";
//
// placesCountTimer
//
this.placesCountTimer.Interval = 60000;
......
......@@ -1249,6 +1249,11 @@ namespace MoyaAdminUI
refreshPlacesCountTexBoxes();
}
private void placesContextMenuStrip_Opening(object sender, CancelEventArgs e)
{
}
}
......
......@@ -1123,6 +1123,89 @@ namespace ImageFilters
grPhoto.Dispose();
return bmPhoto;
}
public static Bitmap Crop(Bitmap bmpPhoto, int Width, int Height, AnchorPosition Anchor, int x, int y)
{
// Size crop
int sourceWidth = bmpPhoto.Width;
int sourceHeight = bmpPhoto.Height;
int sourceX = 0;
int sourceY = 0;
int destX = 0;
int destY = 0;
float nPercent = 0;
float nPercentW = 0;
float nPercentH = 0;
nPercentW = ((float)Width / (float)sourceWidth);
nPercentH = ((float)Height / (float)sourceHeight);
nPercent = nPercentW;
switch (Anchor)
{
case AnchorPosition.Top:
destY = 0;
break;
case AnchorPosition.Bottom:
destY = (int)
(Height - (sourceHeight * nPercent));
break;
case AnchorPosition.Free:
sourceY = (int)
(y - (Height / 2));
break;
default:
destY = (int)
((Height - (sourceHeight * nPercent)) / 2);
break;
}
nPercent = nPercentH;
switch (Anchor)
{
case AnchorPosition.Left:
destX = 0;
break;
case AnchorPosition.Right:
destX = (int)
(Width - (sourceWidth * nPercent));
break;
case AnchorPosition.Free:
sourceX = (int)
(x - (Width / 2));
//destX = (int)
//(Width - (x * nPercent) - (Width /2));
break;
default:
destX = (int)
((Width - (sourceWidth * nPercent)) / 2);
break;
}
int destWidth = (int)(sourceWidth * nPercent);
int destHeight = (int)(sourceHeight * nPercent);
Bitmap bmPhoto = new Bitmap(Width,
Height, PixelFormat.Format24bppRgb);
bmPhoto.SetResolution(bmpPhoto.HorizontalResolution,
bmpPhoto.VerticalResolution);
Graphics grPhoto = Graphics.FromImage(bmPhoto);
grPhoto.InterpolationMode =
InterpolationMode.HighQualityBicubic;
grPhoto.DrawImage(bmpPhoto,
new Rectangle(0, 0, destWidth, destHeight),
new Rectangle(sourceX, sourceY, destWidth, destHeight),
GraphicsUnit.Pixel);
grPhoto.Dispose();
return bmPhoto;
}
}
}
......
......@@ -112,12 +112,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnFinnish.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAH0AAABMCAYAAABAprgtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
......
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RamaSignup</RootNamespace>
<AssemblyName>RamaSignup</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
<FileUpgradeFlags>
......@@ -32,6 +32,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -43,6 +44,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -53,6 +55,8 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoUpdateLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
......@@ -87,6 +91,7 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
......@@ -135,6 +140,15 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="TakePictureControl.resx">
<DependentUpon>TakePictureControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserDetailsEditor.resx">
<DependentUpon>UserDetailsEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserLoginControl.resx">
<DependentUpon>UserLoginControl.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......@@ -144,14 +158,31 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="TakePictureControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="TakePictureControl.Designer.cs">
<DependentUpon>TakePictureControl.cs</DependentUpon>
</Compile>
<Compile Include="TicketType.cs" />
<Compile Include="UserDetailsEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserDetailsEditor.Designer.cs">
<DependentUpon>UserDetailsEditor.cs</DependentUpon>
</Compile>
<Compile Include="UserLoginControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserLoginControl.Designer.cs">
<DependentUpon>UserLoginControl.cs</DependentUpon>
</Compile>
<Compile Include="Util.cs" />
<Compile Include="videosource\Core.cs" />
<Compile Include="videosource\Events.cs" />
<Compile Include="videosource\IVideoSource.cs" />
<Compile Include="videosource\IVideoSourceDescription.cs" />
<Compile Include="videosource\IVideoSourcePage.cs" />
<Compile Include="WebCamera.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
......@@ -174,6 +205,16 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\MoyaAdminLib.csproj">
<Project>{095ce28f-5b53-4203-85c6-3a9afd486407}</Project>
<Name>MoyaAdminLib</Name>
</ProjectReference>
<ProjectReference Include="..\WebCamWrapper\WebCamWrapper.csproj">
<Project>{cc5d5149-0092-4508-ac34-2abe1468a1c9}</Project>
<Name>WebCamWrapper</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaSignup", "MoyaSignup.csproj", "{7264F333-9419-4208-AA6D-223D4CE19C05}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminLib", "..\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\MoyaAdminLib.csproj", "{095CE28F-5B53-4203-85C6-3A9AFD486407}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebCamLib", "..\WebCamLib\WebCamLib.vcxproj", "{FD48314A-9615-4BA6-913A-03787FB2DD30}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebCamWrapper", "..\WebCamWrapper\WebCamWrapper.csproj", "{CC5D5149-0092-4508-AC34-2ABE1468A1C9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Win32.ActiveCfg = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|x64.ActiveCfg = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Any CPU.Build.0 = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Win32.ActiveCfg = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|x64.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.Build.0 = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Win32.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|x64.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Any CPU.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Any CPU.Build.0 = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Win32.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|x64.ActiveCfg = Release|Any CPU
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Any CPU.ActiveCfg = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Win32.ActiveCfg = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Win32.Build.0 = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|x64.ActiveCfg = Debug|x64
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|x64.Build.0 = Debug|x64
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Any CPU.ActiveCfg = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Mixed Platforms.Build.0 = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Win32.ActiveCfg = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Win32.Build.0 = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|x64.ActiveCfg = Release|x64
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|x64.Build.0 = Release|x64
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Win32.ActiveCfg = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|x64.ActiveCfg = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Any CPU.Build.0 = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Win32.ActiveCfg = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|x64.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -15,6 +15,17 @@ namespace RamaSignup
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
Version appVersion = a.GetName().Version;
string appVersionString = appVersion.ToString();
if (Properties.Settings.Default.ApplicationVersion != appVersion.ToString())
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.ApplicationVersion = appVersionString;
}
Application.Run(new Form1());
}
}
......
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18408
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
......
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18408
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
......@@ -12,7 +12,7 @@ namespace RamaSignup.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......@@ -22,5 +22,77 @@ namespace RamaSignup.Properties {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://10.220.105.252:8080/MoyaWeb")]
public string ApiURL {
get {
return ((string)(this["ApiURL"]));
}
set {
this["ApiURL"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("8krAyTEpzP6QnwzkxGek")]
public string ApiApplicationKey {
get {
return ((string)(this["ApiApplicationKey"]));
}
set {
this["ApiApplicationKey"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("tapsa")]
public string ApiUser {
get {
return ((string)(this["ApiUser"]));
}
set {
this["ApiUser"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("6uGbN6GiQqbZy1n,p3hg")]
public string ApiPass {
get {
return ((string)(this["ApiPass"]));
}
set {
this["ApiPass"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string ApplicationVersion {
get {
return ((string)(this["ApplicationVersion"]));
}
set {
this["ApplicationVersion"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string Port {
get {
return ((string)(this["Port"]));
}
set {
this["Port"] = value;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="RamaSignup.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ApiURL" Type="System.String" Scope="User">
<Value Profile="(Default)">http://10.220.105.252:8080/MoyaWeb</Value>
</Setting>
<Setting Name="ApiApplicationKey" Type="System.String" Scope="User">
<Value Profile="(Default)">8krAyTEpzP6QnwzkxGek</Value>
</Setting>
<Setting Name="ApiUser" Type="System.String" Scope="User">
<Value Profile="(Default)">tapsa</Value>
</Setting>
<Setting Name="ApiPass" Type="System.String" Scope="User">
<Value Profile="(Default)">6uGbN6GiQqbZy1n,p3hg</Value>
</Setting>
<Setting Name="ApplicationVersion" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Port" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
namespace RamaSignup
{
partial class TakePictureControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pbIncoming = new System.Windows.Forms.PictureBox();
this.btnTakePic = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).BeginInit();
this.SuspendLayout();
//
// pbIncoming
//
this.pbIncoming.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbIncoming.Location = new System.Drawing.Point(3, 3);
this.pbIncoming.Name = "pbIncoming";
this.pbIncoming.Size = new System.Drawing.Size(299, 411);
this.pbIncoming.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbIncoming.TabIndex = 119;
this.pbIncoming.TabStop = false;
//
// btnTakePic
//
this.btnTakePic.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnTakePic.Location = new System.Drawing.Point(3, 419);
this.btnTakePic.Name = "btnTakePic";
this.btnTakePic.Size = new System.Drawing.Size(299, 36);
this.btnTakePic.TabIndex = 120;
this.btnTakePic.Text = "Ota uusi kuva";
this.btnTakePic.UseVisualStyleBackColor = true;
this.btnTakePic.Click += new System.EventHandler(this.btnTakePic_Click_1);
//
// TakePictureControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnTakePic);
this.Controls.Add(this.pbIncoming);
this.Name = "TakePictureControl";
this.Size = new System.Drawing.Size(306, 461);
this.VisibleChanged += new System.EventHandler(this.TakePictureControl_VisibleChanged);
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PictureBox pbIncoming;
private System.Windows.Forms.Button btnTakePic;
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MoyaAdminLib;
using System.Globalization;
using System.Net;
using System.IO;
namespace RamaSignup
{
public partial class UserDetailsEditor : UserControl
{
public event EventHandler CloseView;
User currentUser = null;
public UserDetailsEditor()
{
InitializeComponent();
cbGender.Items.Add("Valitse");
cbGender.Items.Add("Mies");
cbGender.Items.Add("Nainen");
}
public void LoadUser(User user)
{
btnSaveData.Visible = false;
txtEmail.Text = user.Email;
txtFirstName.Text = user.Firstname;
txtLastName.Text = user.Lastname;
txtNick.Text = user.Nick;
//takePictureControl1.loadUserImage(user);
txtAdress.Text = user.StreetAddress;
txtZip.Text = user.ZipCode;
txtCity.Text = user.postOffice;
txtPhone.Text = user.PhoneNumber;
DateTime birthday = DateTime.MinValue;
DateTime.TryParse(user.Birthday, out birthday);
if (user.Gender == "MALE")
cbGender.SelectedItem = "Mies";
else if (user.Gender == "FEMALE")
cbGender.SelectedItem = "Nainen";
else
cbGender.SelectedItem = "Valitse";
//txtAge.Text = user.Birthday;
if (user.UserId == 0)
{
// new user
takePictureControl1.TakePicture();
txtFirstName.ReadOnly = false;
txtLastName.ReadOnly = false;
txtNick.ReadOnly = false;
txtAdress.ReadOnly = false;
txtZip.ReadOnly = false;
txtCity.ReadOnly = false;
txtPhone.ReadOnly = false;
}
else
{
// old user
takePictureControl1.loadUserImage(user);
}
currentUser = user;
lblMessage.Text = "Voit pyytää muutoksia tietoihin infotiskillä";
}
void clear()
{
this.cbGender.SelectedIndex = 0;
txtAdress.Text = "";
//txtAge.Text = "";
txtCity.Text = "";
txtEmail.Text = "";
txtFirstName.Text = "";
txtNick.Text = "";
txtPhone.Text = "";
txtZip.Text = "";
currentUser = null;
}
void checkFields()
{
string errorType = getErrorMessage();
if (errorType != null)
{
this.lblMessage.Text = errorType + " puuttuu tai on virheellinen. Täytä puuttuvat kentät oikeilla tiedoilla.";
this.lblMessage.ForeColor = Color.Red;
return;
}
}
string getErrorMessage()
{
int tmp;
//checking validity
if (this.txtFirstName.Text.Trim().Length < 5)
{
return "Nimi";
}
else if (this.txtNick.Text.Trim().Length < 2)
{
return "Nick (nimimerkki)";
}
/*else if (this.txtAge.Text.Trim().Length < 1 || (!int.TryParse(this.txtAge.Text.Trim(), out tmp)))
{
return "Syntymäaika";
}*/
else if (this.cbGender.SelectedIndex == 0)
{
return "Sukupuoli";
}
else if (this.txtPhone.Text.Length < 2)
{
return "Puhelinnumero";
}
else if (this.txtEmail.Text.Trim().Length < 5)
{
return "Sähköposti";
}
else if (this.txtAdress.Text.Trim().Length < 2)
{
return "Lähiosoite";
}
else if (this.txtZip.Text.Trim().Length != 5 || (!int.TryParse(this.txtZip.Text.Trim(), out tmp)))
{
return "Postinumero";
}
else if (this.txtCity.Text.Trim().Length < 2)
{
return "Paikkakunta";
}
else
{
return null;
}
}
private void UserDetailsEditor_Load(object sender, EventArgs e)
{
lblMessage.Text = "";
takePictureControl1.Changed += takePictureControl1_Changed;
}
void takePictureControl1_Changed(object sender, EventArgs e)
{
btnSaveData.Visible = true;
}
private void btnSaveData_Click(object sender, EventArgs e)
{
if (currentUser.UserId > 0)
takePictureControl1.SaveUserImage(currentUser);
else
{
}
onCloseView();
}
private void btnCancel_Click(object sender, EventArgs e)
{
onCloseView();
}
private void onCloseView()
{
clear();
if (CloseView != null)
CloseView(this, null);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
namespace RamaSignup
{
partial class UserLoginControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.label4 = new System.Windows.Forms.Label();
this.txtEmail = new System.Windows.Forms.TextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.infoLabel = new System.Windows.Forms.Label();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.loginButton = new System.Windows.Forms.Button();
this.forgottenPasswordButton = new System.Windows.Forms.Button();
this.btnNewProfile = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label4
//
this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.Location = new System.Drawing.Point(13, 12);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(52, 16);
this.label4.TabIndex = 68;
this.label4.Text = "E-Mail";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtEmail
//
this.txtEmail.BackColor = System.Drawing.SystemColors.Window;
this.txtEmail.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtEmail.Location = new System.Drawing.Point(16, 31);
this.txtEmail.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtEmail.Name = "txtEmail";
this.txtEmail.Size = new System.Drawing.Size(395, 26);
this.txtEmail.TabIndex = 67;
this.txtEmail.TextChanged += new System.EventHandler(this.txtEmail_TextChanged);
//
// timer1
//
this.timer1.Interval = 500;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// infoLabel
//
this.infoLabel.AutoSize = true;
this.infoLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.infoLabel.Location = new System.Drawing.Point(13, 67);
this.infoLabel.Name = "infoLabel";
this.infoLabel.Size = new System.Drawing.Size(12, 16);
this.infoLabel.TabIndex = 69;
this.infoLabel.Text = " ";
//
// passwordTextBox
//
this.passwordTextBox.BackColor = System.Drawing.SystemColors.Window;
this.passwordTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.passwordTextBox.Location = new System.Drawing.Point(16, 86);
this.passwordTextBox.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.PasswordChar = '*';
this.passwordTextBox.Size = new System.Drawing.Size(125, 26);
this.passwordTextBox.TabIndex = 93;
this.passwordTextBox.Visible = false;
this.passwordTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.passwordTextBox_KeyDown);
//
// loginButton
//
this.loginButton.Location = new System.Drawing.Point(148, 86);
this.loginButton.Name = "loginButton";
this.loginButton.Size = new System.Drawing.Size(118, 26);
this.loginButton.TabIndex = 94;
this.loginButton.Text = "Kirjaudu tapahtumaan";
this.loginButton.UseVisualStyleBackColor = true;
this.loginButton.Visible = false;
this.loginButton.Click += new System.EventHandler(this.loginButton_Click);
//
// forgottenPasswordButton
//
this.forgottenPasswordButton.Location = new System.Drawing.Point(272, 86);
this.forgottenPasswordButton.Name = "forgottenPasswordButton";
this.forgottenPasswordButton.Size = new System.Drawing.Size(139, 26);
this.forgottenPasswordButton.TabIndex = 95;
this.forgottenPasswordButton.Text = "En muista salasanaani";
this.forgottenPasswordButton.UseVisualStyleBackColor = true;
this.forgottenPasswordButton.Visible = false;
//
// btnNewProfile
//
this.btnNewProfile.Location = new System.Drawing.Point(16, 86);
this.btnNewProfile.Name = "btnNewProfile";
this.btnNewProfile.Size = new System.Drawing.Size(126, 26);
this.btnNewProfile.TabIndex = 96;
this.btnNewProfile.Text = "Lisää omat tiedot";
this.btnNewProfile.UseVisualStyleBackColor = true;
this.btnNewProfile.Visible = false;
this.btnNewProfile.Click += new System.EventHandler(this.btnNewProfile_Click);
//
// UserLoginControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnNewProfile);
this.Controls.Add(this.forgottenPasswordButton);
this.Controls.Add(this.loginButton);
this.Controls.Add(this.passwordTextBox);
this.Controls.Add(this.infoLabel);
this.Controls.Add(this.label4);
this.Controls.Add(this.txtEmail);
this.Name = "UserLoginControl";
this.Size = new System.Drawing.Size(420, 126);
this.Load += new System.EventHandler(this.UserLoginControl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtEmail;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label infoLabel;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.Button loginButton;
private System.Windows.Forms.Button forgottenPasswordButton;
private System.Windows.Forms.Button btnNewProfile;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MoyaAdminLib;
using System.Web.Script.Serialization;
using System.Net;
namespace RamaSignup
{
public partial class UserLoginControl : UserControl
{
public event EventHandler LoginOk;
public UserLoginControl()
{
InitializeComponent();
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.Transparent;
infoLabel.Text = "Hei! Kirjoita sähköpostiosoitteesi";
}
private void UserLoginControl_Load(object sender, EventArgs e)
{
}
private void txtEmail_TextChanged(object sender, EventArgs e)
{
string txt = txtEmail.Text;
if (IsValidEmail(txt))
{
timer1.Stop();
timer1.Start();
}
else
{
timer1.Stop();
CurrentUser = null;
btnNewProfile.Visible = false;
infoLabel.Text = "Hei! Kirjoita sähköpostiosoitteesi";
}
}
bool IsValidEmail(string email)
{
if (!email.Contains("@") || !email.Contains("."))
return false;
string[] parts = email.Split(new string[] { "@" }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Count<string>() == 2)
{
if (!parts[1].Contains("."))
return false;
string[] domainparts = parts[1].Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries);
if (domainparts.Count<string>() < 2)
return false;
string ltd = domainparts[domainparts.Count<string>() - 1];
if (ltd.Length < 2)
return false;
}
else return false;
try
{
var addr = new System.Net.Mail.MailAddress(email);
return addr.Address == email;
}
catch
{
return false;
}
}
public User CurrentUser;
private void timer1_Tick(object sender, EventArgs e)
{
RestClient client = new RestClient();
try
{
string json = client.MakeRequest("user", "email=" + txtEmail.Text);
JavaScriptSerializer ser = new JavaScriptSerializer();
Eventuser euser = ser.Deserialize<Eventuser>(json);
if (euser != null)
{
btnNewProfile.Visible = false;
CurrentUser = new User(euser);
infoLabel.Text = "Hei! " + CurrentUser.ToString() + " Kirjoita salasanasi ja kirjaudu";
showLogin(true);
}
}
catch (Exception ex)
{
CurrentUser = null;
infoLabel.Text = "Uusi kävijä?";
btnNewProfile.Visible = true;
showLogin(false);
}
timer1.Stop();
}
void showLogin(bool show)
{
passwordTextBox.Visible = show;
loginButton.Visible = show;
}
private void login()
{
RestClient client;
client = new RestClient(RestClient.ApiURL, HttpVerb.POST);
//client.PostData = "password=" + WebUtility.UrlEncode(passwordTextBox.Text);
client.PostData = "password=" + passwordTextBox.Text;
client.ContentType = "application/x-www-form-urlencoded";
try
{
string json = client.MakeRequest("v2/user/" + CurrentUser.UserId + "/check-password");
//string json2 = client.MakeRequest("user/"+ CurrentUser.UserId +"/check-password");
///MoyaWeb/rest/user/eventusers
JavaScriptSerializer ser = new JavaScriptSerializer();
Eventuser euser = ser.Deserialize<Eventuser>(json);
if (euser != null)
{
CurrentUser = new User(euser);
CurrentUser.Email = txtEmail.Text;
if (LoginOk != null)
LoginOk(this, null);
}
else
wrongPass();
}
catch (Exception ex)
{
wrongPass();
}
}
private void loginButton_Click(object sender, EventArgs e)
{
login();
}
private void wrongPass()
{
infoLabel.Text = "Väärä salasana. Syötä salasana uudelleen";
}
private void passwordTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter)
login();
}
private void btnNewProfile_Click(object sender, EventArgs e)
{
CurrentUser = new User();
CurrentUser.Email = txtEmail.Text;
//Send info to parent control
if (LoginOk != null)
LoginOk(this, null);
}
internal void Clear()
{
CurrentUser = null;
txtEmail.Text = "";
passwordTextBox.Text = "";
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace WebCam
{
public class WebCameraEventArgs : EventArgs
{
private System.Drawing.Bitmap bitMap;
private byte[] data;
public WebCameraEventArgs(byte[] videoData, System.Drawing.Bitmap bmp)
{
data = videoData;
bitMap = bmp;
}
public byte[] Data
{
get
{
return data;
}
}
public System.Drawing.Bitmap Bitmap
{
get
{
return bitMap;
}
}
}
public class WebCamera
{
public WebCamera(IntPtr handle, int width, int height)
{
mControlPtr = handle;
mWidth = width;
mHeight = height;
}
// delegate for frame callback
public delegate void RecievedFrameEventHandler(object sender,WebCameraEventArgs e);
public event RecievedFrameEventHandler RecievedFrame;
private IntPtr lwndC; // Holds the unmanaged handle of the control
private IntPtr mControlPtr; // Holds the managed pointer of the control
private int mWidth;
private int mHeight;
private API32.FrameEventHandler mFrameEventHandler; // Delegate instance for the frame callback - must keep alive! gc should NOT collect it
// Close the web camera
public void CloseWebcam()
{
this.capDriverDisconnect(this.lwndC);
}
// start the web camera
public bool StartWebCam()
{
byte[] lpszName = new byte[100];
byte[] lpszVer = new byte[100];
API32.capGetDriverDescriptionA(0, lpszName, 100, lpszVer, 100);
this.lwndC = API32.capCreateCaptureWindowA(lpszName, API32.WS_VISIBLE + API32.WS_CHILD, 0, 0, mWidth, mHeight, mControlPtr, 0);
if (this.capDriverConnect(this.lwndC, 0))
{
this.capPreviewRate(this.lwndC, 100);
//this.capPreview(this.lwndC, false); // resurssi, pivitetnk kuvaa jatkuvasti
API32.BITMAPINFO bitmapinfo = new API32.BITMAPINFO();
bitmapinfo.bmiHeader.biSize = API32.SizeOf(bitmapinfo.bmiHeader);
bitmapinfo.bmiHeader.biWidth = mWidth;
bitmapinfo.bmiHeader.biHeight = mHeight;
bitmapinfo.bmiHeader.biPlanes = 1;
bitmapinfo.bmiHeader.biBitCount = 24;
this.capSetVideoFormat(this.lwndC, ref bitmapinfo, API32.SizeOf(bitmapinfo));
this.mFrameEventHandler = new API32.FrameEventHandler(FrameCallBack);
this.capSetCallbackOnFrame(this.lwndC, this.mFrameEventHandler);
API32.SetWindowPos(this.lwndC, 0, 0, 0, mWidth, mHeight, 6);
return true;
}
return false;
}
// private functions
private bool capDriverConnect(IntPtr lwnd, short i)
{
return API32.SendMessage(lwnd, API32.WM_CAP_DRIVER_CONNECT, i, 0);
}
private bool capDriverDisconnect(IntPtr lwnd)
{
return API32.SendMessage(lwnd, API32.WM_CAP_DRIVER_DISCONNECT, 0, 0);
}
private bool capPreview(IntPtr lwnd, bool f)
{
return API32.SendMessage(lwnd, API32.WM_CAP_SET_PREVIEW, f, 0);
}
private bool capPreviewRate(IntPtr lwnd, short wMS)
{
return API32.SendMessage(lwnd, API32.WM_CAP_SET_PREVIEWRATE, wMS, 0);
}
private bool capSetCallbackOnFrame(IntPtr lwnd, API32.FrameEventHandler lpProc)
{
return API32.SendMessage(lwnd, API32.WM_CAP_SET_CALLBACK_FRAME, 0, lpProc);
}
private bool capSetVideoFormat(IntPtr hCapWnd, ref API32.BITMAPINFO BmpFormat, int CapFormatSize)
{
return API32.SendMessage(hCapWnd, API32.WM_CAP_SET_VIDEOFORMAT, CapFormatSize, ref BmpFormat);
}
private bool capDlgVideoFormat(IntPtr lwnd)
{
return API32.SendMessage(lwnd, API32.WM_CAP_DLG_VIDEOFORMAT, 0, 0);
}
public void ShowConfigDialog()
{
CloseWebcam();
byte[] lpszName = new byte[100];
byte[] lpszVer = new byte[100];
API32.capGetDriverDescriptionA(0, lpszName, 100,lpszVer, 100);
this.lwndC = API32.capCreateCaptureWindowA(lpszName, API32.WS_VISIBLE + API32.WS_CHILD, 0, 0, mWidth, mHeight, mControlPtr, 0);
if (capDriverConnect(this.lwndC ,0))
{
capDlgVideoFormat(this.lwndC);
CloseWebcam();
}
else
throw new Exception("Camera not found");
}
private void FrameCallBack(IntPtr lwnd, IntPtr lpVHdr)
{
API32.VIDEOHDR videoHeader = new API32.VIDEOHDR();
byte[] VideoData;
videoHeader = (API32.VIDEOHDR)API32.GetStructure(lpVHdr, videoHeader);
VideoData = new byte[videoHeader.dwBytesUsed];
API32.Copy(videoHeader.lpData, VideoData);
System.Drawing.Bitmap bmp = new Bitmap(mWidth, mHeight);
System.Drawing.Imaging.BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, mWidth, mHeight), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
//System.Drawing.Imaging.BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, mWidth, mHeight), ImageLockMode.ReadWrite, PixelFormat.);
// Copy the data from memory to the Scan0 property of our Bitmap
/* int l = VideoData.Length;
for (int i = 0; i < l; i++)
{
Marshal.WriteByte(bmpData.Scan0, i, VideoData[i]);
}
*/
Marshal.Copy(VideoData, 0, bmpData.Scan0, VideoData.Length);
bmp.UnlockBits(bmpData);
if (this.RecievedFrame != null)
{
WebCameraEventArgs e = new WebCameraEventArgs(VideoData, bmp);
this.RecievedFrame(this,e);
}
}
}
}
<?xml version="1.0"?>
<configuration>
<runtime>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="RamaSignup.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Npgsql" publicKeyToken="5D8B90D52F46FDA7" culture="neutral"/>
......@@ -8,4 +13,26 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
<userSettings>
<RamaSignup.Properties.Settings>
<setting name="ApiURL" serializeAs="String">
<value>http://10.220.105.252:8080/MoyaWeb</value>
</setting>
<setting name="ApiApplicationKey" serializeAs="String">
<value>8krAyTEpzP6QnwzkxGek</value>
</setting>
<setting name="ApiUser" serializeAs="String">
<value>tapsa</value>
</setting>
<setting name="ApiPass" serializeAs="String">
<value>6uGbN6GiQqbZy1n,p3hg</value>
</setting>
<setting name="ApplicationVersion" serializeAs="String">
<value />
</setting>
<setting name="Port" serializeAs="String">
<value />
</setting>
</RamaSignup.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
......@@ -20,3 +20,25 @@ D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.Properties.Resou
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\MoyaSignup.csproj.GenerateResource.Cache
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.exe
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.exe.config
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.exe
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.exe
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\AutoUpdateLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\AutoUpdateLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\MoyaSignup.csprojResolveAssemblyReference.cache
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.Form1.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\mjpeg.MJPEGSourcePage.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.Properties.Resources.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\MoyaSignup.csproj.GenerateResource.Cache
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.UserLoginControl.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.UserDetailsEditor.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.TakePictureControl.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\Touchless.Vision.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\WebCamLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\System.ComponentModel.Composition.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\Touchless.Vision.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaSignup\bin\Debug\WebCamLib.pdb
//*****************************************************************************************
// File: WebCamLib.h
// Project: WebcamLib
// Author(s): John Conwell
// Gary Caldwell
//
// Declares the webcam DirectShow wrapper used by TouchlessLib
//*****************************************************************************************
#pragma once
using namespace System;
using namespace System::Runtime::InteropServices;
namespace WebCamLib
{
/// <summary>
/// Store webcam name, index
/// </summary>
public ref class CameraInfo
{
public:
property int index;
property String^ name;
};
/// <summary>
/// DirectShow wrapper around a web cam, used for image capture
/// </summary>
public ref class CameraMethods
{
public:
/// <summary>
/// Initializes information about all web cams connected to machine
/// </summary>
CameraMethods();
/// <summary>
/// Delegate used by DirectShow to pass back captured images from webcam
/// </summary>
delegate void CaptureCallbackDelegate(
int dwSize,
[MarshalAsAttribute(UnmanagedType::LPArray, ArraySubType = UnmanagedType::I1, SizeParamIndex = 0)] array<System::Byte>^ abData);
/// <summary>
/// Event callback to capture images from webcam
/// </summary>
event CaptureCallbackDelegate^ OnImageCapture;
/// <summary>
/// Retrieve information about a specific camera
/// Use the count property to determine valid indicies to pass in
/// </summary>
CameraInfo^ GetCameraInfo(int camIndex);
/// <summary>
/// Start the camera associated with the input handle
/// </summary>
void StartCamera(int camIndex, interior_ptr<int> width, interior_ptr<int> height);
/// <summary>
/// Set VideoProcAmpProperty
/// </summary>
void SetProperty(long lProperty, long lValue, bool bAuto);
/// <summary>
/// Stops the currently running camera and cleans up any global resources
/// </summary>
void Cleanup();
/// <summary>
/// Stops the currently running camera
/// </summary>
void StopCamera();
/// <summary>
/// Show the properties dialog for the specified webcam
/// </summary>
void DisplayCameraPropertiesDialog(int camIndex);
/// <summary>
/// Count of the number of cameras installed
/// </summary>
property int Count;
/// <summary>
/// Queries which camera is currently running via StartCamera(), -1 for none
/// </summary>
property int ActiveCameraIndex
{
int get()
{
return activeCameraIndex;
}
}
/// <summary>
/// IDisposable
/// </summary>
~CameraMethods();
protected:
/// <summary>
/// Finalizer
/// </summary>
!CameraMethods();
private:
/// <summary>
/// Pinned pointer to delegate for CaptureCallbackDelegate
/// Keeps the delegate instance in one spot
/// </summary>
GCHandle ppCaptureCallback;
/// <summary>
/// Initialize information about webcams installed on machine
/// </summary>
void RefreshCameraList();
/// <summary>
/// Has dispose already happened?
/// </summary>
bool disposed;
/// <summary>
/// Which camera is running? -1 for none
/// </summary>
int activeCameraIndex;
/// <summary>
/// Releases all unmanaged resources
/// </summary>
void CleanupCameraInfo();
/// <summary>
/// Setup the callback functionality for DirectShow
/// </summary>
HRESULT ConfigureSampleGrabber(IBaseFilter *pIBaseFilter);
HRESULT SetCaptureFormat(IBaseFilter* pCap, int width, int height);
};
// Forward declarations of callbacks
typedef void (__stdcall *PFN_CaptureCallback)(DWORD dwSize, BYTE* pbData);
PFN_CaptureCallback g_pfnCaptureCallback = NULL;
/// <summary>
/// Lightweight SampleGrabber callback interface
/// </summary>
class SampleGrabberCB : public ISampleGrabberCB
{
public:
SampleGrabberCB()
{
m_nRefCount = 0;
}
virtual HRESULT STDMETHODCALLTYPE SampleCB(double SampleTime, IMediaSample *pSample)
{
return E_FAIL;
}
virtual HRESULT STDMETHODCALLTYPE BufferCB(double SampleTime, BYTE *pBuffer, long BufferLen)
{
if (g_pfnCaptureCallback != NULL)
{
g_pfnCaptureCallback(BufferLen, pBuffer);
}
return S_OK;
}
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
{
return E_FAIL; // Not a very accurate implementation
}
virtual ULONG STDMETHODCALLTYPE AddRef()
{
return ++m_nRefCount;
}
virtual ULONG STDMETHODCALLTYPE Release()
{
int n = --m_nRefCount;
if (n <= 0)
{
delete this;
}
return n;
}
private:
int m_nRefCount;
};
}

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebCamLib", "WebCamLib.vcxproj", "{FD48314A-9615-4BA6-913A-03787FB2DD30}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Win32.ActiveCfg = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Win32.Build.0 = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Win32.ActiveCfg = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="WebCamLib"
ProjectGUID="{FD48314A-9615-4BA6-913A-03787FB2DD30}"
RootNamespace="WebCamLib"
Keyword="ManagedCProj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
IntermediateDirectory="bin\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
ManagedExtensions="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Strmiids.lib"
OutputFile="bin\$(ConfigurationName)\$(ProjectName).dll"
LinkIncremental="2"
GenerateDebugInformation="true"
AssemblyDebug="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ProjectDir)bin\$(ConfigurationName)"
IntermediateDirectory="$(ProjectDir)bin\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
ManagedExtensions="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="4"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Strmiids.lib"
LinkIncremental="1"
GenerateDebugInformation="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
ManagedExtensions="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Strmiids.lib"
OutputFile="bin\$(ConfigurationName)\$(ProjectName).dll"
LinkIncremental="2"
GenerateDebugInformation="true"
AssemblyDebug="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(ProjectDir)bin\$(ConfigurationName)"
IntermediateDirectory="$(ProjectDir)bin\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
ManagedExtensions="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="4"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Strmiids.lib"
LinkIncremental="1"
GenerateDebugInformation="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
<AssemblyReference
RelativePath="System.dll"
AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
MinFrameworkVersion="131072"
/>
<AssemblyReference
RelativePath="System.Data.dll"
AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
MinFrameworkVersion="131072"
/>
<AssemblyReference
RelativePath="System.XML.dll"
AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
MinFrameworkVersion="131072"
/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\WebCamLib.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\WebCamLib.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
</VisualStudioProject>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Header Files\Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="WebCamLib.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="WebCamLib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="qedit.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
///////////////////////////////////////////////////////////////////////////////////
#ifndef __qedit_h__
#define __qedit_h__
///////////////////////////////////////////////////////////////////////////////////
#pragma once
///////////////////////////////////////////////////////////////////////////////////
interface
ISampleGrabberCB
:
public IUnknown
{
virtual STDMETHODIMP SampleCB( double SampleTime, IMediaSample *pSample ) = 0;
virtual STDMETHODIMP BufferCB( double SampleTime, BYTE *pBuffer, long BufferLen ) = 0;
};
///////////////////////////////////////////////////////////////////////////////////
static
const
IID IID_ISampleGrabberCB = { 0x0579154A, 0x2B53, 0x4994, { 0xB0, 0xD0, 0xE7, 0x73, 0x14, 0x8E, 0xFF, 0x85 } };
///////////////////////////////////////////////////////////////////////////////////
interface
ISampleGrabber
:
public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE SetOneShot( BOOL OneShot ) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMediaType( const AM_MEDIA_TYPE *pType ) = 0;
virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType( AM_MEDIA_TYPE *pType ) = 0;
virtual HRESULT STDMETHODCALLTYPE SetBufferSamples( BOOL BufferThem ) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer( long *pBufferSize, long *pBuffer ) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentSample( IMediaSample **ppSample ) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCallback( ISampleGrabberCB *pCallback, long WhichMethodToCallback ) = 0;
};
///////////////////////////////////////////////////////////////////////////////////
static
const
IID IID_ISampleGrabber = { 0x6B652FFF, 0x11FE, 0x4fce, { 0x92, 0xAD, 0x02, 0x66, 0xB5, 0xD7, 0xC7, 0x8F } };
///////////////////////////////////////////////////////////////////////////////////
static
const
CLSID CLSID_SampleGrabber = { 0xC1F400A0, 0x3F08, 0x11d3, { 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 } };
///////////////////////////////////////////////////////////////////////////////////
static
const
CLSID CLSID_NullRenderer = { 0xC1F400A4, 0x3F08, 0x11d3, { 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 } };
///////////////////////////////////////////////////////////////////////////////////
static
const
CLSID CLSID_VideoEffects1Category = { 0xcc7bfb42, 0xf175, 0x11d1, { 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59 } };
///////////////////////////////////////////////////////////////////////////////////
static
const
CLSID CLSID_VideoEffects2Category = { 0xcc7bfb43, 0xf175, 0x11d1, { 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59 } };
///////////////////////////////////////////////////////////////////////////////////
static
const
CLSID CLSID_AudioEffects1Category = { 0xcc7bfb44, 0xf175, 0x11d1, { 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59 } };
///////////////////////////////////////////////////////////////////////////////////
static
const
CLSID CLSID_AudioEffects2Category = { 0xcc7bfb45, 0xf175, 0x11d1, { 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59 } };
///////////////////////////////////////////////////////////////////////////////////
#endif
///////////////////////////////////////////////////////////////////////////////////
\ No newline at end of file
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using WebCamLib;
namespace Touchless.Vision.Camera
{
/// <summary>
/// Represents a camera in use by the Touchless system
/// </summary>
public class Camera : IDisposable
{
private readonly CameraMethods _cameraMethods;
private RotateFlipType _rotateFlip = RotateFlipType.RotateNoneFlipNone;
public Camera(CameraMethods cameraMethods, string name, int index)
{
_cameraMethods = cameraMethods;
_name = name;
_index = index;
_cameraMethods.OnImageCapture += CaptureCallbackProc;
}
public string Name
{
get { return _name; }
}
/// <summary>
/// Defines the frames per second limit that is in place, -1 means no limit
/// </summary>
public int Fps
{
get { return _fpslimit; }
set
{
_fpslimit = value;
_timeBetweenFrames = (1000.0 / _fpslimit);
}
}
/// <summary>
/// Determines the width of the image captured
/// </summary>
public int CaptureWidth
{
get
{
return _width;
}
set
{
_width = value;
}
}
/// <summary>
/// Defines the height of the image captured
/// </summary>
public int CaptureHeight
{
get
{
return _height;
}
set
{
_height = value;
}
}
public bool HasFrameLimit
{
get { return _fpslimit != -1; }
}
public bool FlipHorizontal
{
get
{
return RotateFlip == RotateFlipType.RotateNoneFlipX || RotateFlip == RotateFlipType.Rotate180FlipNone;
}
set
{
if (value && FlipVertical)
{
RotateFlip = RotateFlipType.Rotate180FlipNone;
}
else if (value && !FlipVertical)
{
RotateFlip = RotateFlipType.RotateNoneFlipX;
}
else if (!value && FlipVertical)
{
RotateFlip = RotateFlipType.Rotate180FlipX;
}
else if (!value && !FlipVertical)
{
RotateFlip = RotateFlipType.RotateNoneFlipNone;
}
}
}
public bool FlipVertical
{
get
{
return RotateFlip == RotateFlipType.Rotate180FlipX || RotateFlip == RotateFlipType.Rotate180FlipNone;
}
set
{
if (value && FlipHorizontal)
{
RotateFlip = RotateFlipType.Rotate180FlipNone;
}
else if (value && !FlipHorizontal)
{
RotateFlip = RotateFlipType.Rotate180FlipX;
}
else if (!value && FlipHorizontal)
{
RotateFlip = RotateFlipType.RotateNoneFlipX;
}
else if (!value && !FlipHorizontal)
{
RotateFlip = RotateFlipType.RotateNoneFlipNone;
}
}
}
/// <summary>
/// Command for rotating and flipping incoming images
/// </summary>
public RotateFlipType RotateFlip
{
get { return _rotateFlip; }
set
{
// Swap height/width when rotating by 90 or 270
if ((int)_rotateFlip % 2 != (int)value % 2)
{
int temp = CaptureWidth;
CaptureWidth = CaptureHeight;
CaptureHeight = temp;
}
_rotateFlip = value;
}
}
#region IDisposable Members
/// <summary>
/// Cleanup function for the camera
/// </summary>
public void Dispose()
{
StopCapture();
}
#endregion
/// <summary>
/// Returns the last image acquired from the camera
/// </summary>
/// <returns>A bitmap of the last image acquired from the camera</returns>
public Bitmap GetCurrentImage()
{
Bitmap b = null;
lock (_bitmapLock)
{
if (_bitmap == null)
{
return null;
}
b = (Bitmap)_bitmap.Clone();
}
return b;
}
public void ShowPropertiesDialog()
{
_cameraMethods.DisplayCameraPropertiesDialog(_index);
}
public void GetCameraInfo()
{
_cameraMethods.GetCameraInfo(_index);
}
public void SetProperty(int property, int value, bool auto) // bntr
{
_cameraMethods.SetProperty(property, value, auto);
}
/// <summary>
/// Event fired when an image from the camera is captured
/// </summary>
public event EventHandler<CameraEventArgs> OnImageCaptured;
/// <summary>
/// Returns the camera name as the ToString implementation
/// </summary>
/// <returns>The name of the camera</returns>
public override string ToString()
{
return _name;
}
#region Internal Implementation
private readonly object _bitmapLock = new object();
private readonly int _index;
private readonly string _name;
private Bitmap _bitmap;
private DateTime _dtLastCap = DateTime.MinValue;
private int _fpslimit = -1;
private int _height = 240;
private double _timeBehind;
private double _timeBetweenFrames;
private int _width = 320;
internal void StartCapture()
{
_cameraMethods.StartCamera(_index, ref _width, ref _height);
}
internal void StopCapture()
{
_cameraMethods.StopCamera();
}
/// <summary>
/// Here is where the images come in as they are collected, as fast as they can and on a background thread
/// </summary>
private void CaptureCallbackProc(int dataSize, byte[] data)
{
// Do the magic to create a bitmap
int stride = _width * 3;
GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned);
var scan0 = (int)handle.AddrOfPinnedObject();
scan0 += (_height - 1) * stride;
var b = new Bitmap(_width, _height, -stride, PixelFormat.Format24bppRgb, (IntPtr)scan0);
b.RotateFlip(_rotateFlip);
// NOTE: It seems that bntr has made that resolution property work properly
var copyBitmap = (Bitmap)b.Clone();
// Copy the image using the Thumbnail function to also resize if needed
//var copyBitmap = (Bitmap)b.GetThumbnailImage(_width, _height, null, IntPtr.Zero);
// Now you can free the handle
handle.Free();
ImageCaptured(copyBitmap);
}
private void ImageCaptured(Bitmap bitmap)
{
DateTime dtCap = DateTime.Now;
// Always save the bitmap
lock (_bitmapLock)
{
_bitmap = bitmap;
}
// FPS affects the callbacks only
if (_fpslimit != -1)
{
if (_dtLastCap != DateTime.MinValue)
{
double milliseconds = ((dtCap.Ticks - _dtLastCap.Ticks) / TimeSpan.TicksPerMillisecond) * 1.15;
if (milliseconds + _timeBehind >= _timeBetweenFrames)
{
_timeBehind = (milliseconds - _timeBetweenFrames);
if (_timeBehind < 0.0)
{
_timeBehind = 0.0;
}
}
else
{
_timeBehind = 0.0;
return; // ignore the frame
}
}
}
if (OnImageCaptured != null)
{
var fps = (int)(1 / dtCap.Subtract(_dtLastCap).TotalSeconds);
OnImageCaptured.Invoke(this, new CameraEventArgs(bitmap, fps));
}
_dtLastCap = dtCap;
}
#endregion
}
/// <summary>
/// Camera specific EventArgs that provides the Image being captured
/// </summary>
public class CameraEventArgs : EventArgs
{
/// <summary>
/// Current Camera Image
/// </summary>
public Bitmap Image
{
get { return _image; }
}
public int CameraFps
{
get { return _cameraFps; }
}
#region Internal Implementation
private readonly int _cameraFps;
private readonly Bitmap _image;
internal CameraEventArgs(Bitmap i, int fps)
{
_image = i;
_cameraFps = fps;
}
#endregion
}
}
\ No newline at end of file
using System;
using System.ComponentModel.Composition;
using Touchless.Vision.Camera.Configuration;
using Touchless.Vision.Contracts;
namespace Touchless.Vision.Camera
{
[Export(typeof(IFrameSource))]
public class CameraFrameSource : IFrameSource
{
public event Action<IFrameSource, Frame, double> NewFrame;
public bool IsCapturing { get; private set; }
private Camera _camera;
public Camera Camera
{
get { return _camera; }
internal set
{
if (_camera != value)
{
bool restart = IsCapturing;
if (IsCapturing)
{
StopFrameCapture();
}
_camera = value;
if (restart)
{
StartFrameCapture();
}
}
}
}
[ImportingConstructor]
public CameraFrameSource([Import(ExportInterfaceNames.DefaultCamera)] Camera camera)
{
if (camera == null) throw new ArgumentNullException("camera");
this.Camera = camera;
}
public void StartFrameCapture()
{
if (!IsCapturing && this.Camera != null)
{
this.Camera.OnImageCaptured += OnImageCaptured;
this.Camera.StartCapture();
IsCapturing = true;
}
}
public void StopFrameCapture()
{
if (IsCapturing)
{
this.Camera.StopCapture();
this.Camera.OnImageCaptured += OnImageCaptured;
this.IsCapturing = false;
}
}
private void OnImageCaptured(object sender, CameraEventArgs e)
{
if (IsCapturing && this.NewFrame != null)
{
var frame = new Frame(e.Image);
this.NewFrame(this, frame, e.CameraFps);
}
}
public string Name
{
get { return "Touchless Camera Frame Source"; }
}
public string Description
{
get { return "Retrieves frames from Camera"; }
}
public bool HasConfiguration
{
get { return true; }
}
public System.Windows.UIElement ConfigurationElement
{
get
{
return new CameraFrameSourceConfigurationElement(this);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.ComponentModel.Composition;
namespace Touchless.Vision.Camera
{
public static class CameraService
{
private static WebCamLib.CameraMethods _cameraMethods;
private static WebCamLib.CameraMethods CameraMethods
{
get
{
if (_cameraMethods == null)
{
_cameraMethods = new WebCamLib.CameraMethods();
}
return _cameraMethods;
}
}
[Export(ExportInterfaceNames.DefaultCamera)]
public static Camera DefaultCamera
{
get { return AvailableCameras.FirstOrDefault(); }
}
private static List<Camera> _availableCameras;
public static IEnumerable<Camera> AvailableCameras
{
get
{
if (_availableCameras == null)
{
_availableCameras = BuildCameraList().ToList();
}
return _availableCameras;
}
}
private static IEnumerable<Camera> BuildCameraList()
{
for (int i = 0; i < CameraMethods.Count; i++)
{
WebCamLib.CameraInfo cameraInfo = CameraMethods.GetCameraInfo(i);
yield return new Camera(CameraMethods, cameraInfo.name, cameraInfo.index);
}
}
}
}
<UserControl x:Class="Touchless.Vision.Camera.Configuration.CameraFrameSourceConfigurationElement"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="550" Height="260">
<GroupBox Header="Camera Settings">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Width="200">
<ComboBox x:Name="comboBoxCameras" SelectionChanged="comboBoxCameras_SelectionChanged" />
<StackPanel x:Name="panelCameraInfo" Orientation="Vertical" MinWidth="180" DataContext="{Binding SelectedItem, ElementName=comboBoxCameras, Mode=Default}">
<Button Click="buttonCameraProperties_Click" x:Name="buttonCameraProperties" Content="Adjust Camera Properties" Margin="0,10,0,10" />
<CheckBox Content="Flip Image Horizontally" IsChecked="{Binding FlipHorizontal, Mode=TwoWay}" />
<CheckBox Content="Flip Image Vertically" IsChecked="{Binding FlipVertical, Mode=TwoWay}" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,10">
<Label VerticalAlignment="Center" Margin="-1">Current Frames Per Second:</Label>
<Label x:Name="labelCameraFPSValue" Content="{Binding Fps, Mode=Default}" Margin="3,0,0,0" Width="40" HorizontalContentAlignment="Right"></Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox x:Name="chkLimitFps" Content="Limit Frames Per Second:" VerticalAlignment="Center" Checked="chkLimitFps_Checked" Unchecked="chkLimitFps_Unchecked" />
<TextBox x:Name="txtLimitFps" Margin="10,0,0,0" Text="-1" Width="40" VerticalAlignment="Center" MaxLines="1" HorizontalContentAlignment="Right" IsEnabled="False" TextChanged="txtLimitFps_TextChanged" />
</StackPanel>
</StackPanel>
</StackPanel>
<Image x:Name="imgPreview" Width="320" Height="240" Margin="10,0,10,0" Stretch="Fill" VerticalAlignment="Top" />
</StackPanel>
</GroupBox>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using Touchless.Shared.Extensions;
namespace Touchless.Vision.Camera.Configuration
{
/// <summary>
/// Interaction logic for CameraFrameSourceConfigurationElement.xaml
/// </summary>
public partial class CameraFrameSourceConfigurationElement : UserControl
{
private readonly CameraFrameSource _cameraFrameSource;
public CameraFrameSourceConfigurationElement()
: this(null)
{
}
public CameraFrameSourceConfigurationElement(CameraFrameSource cameraFrameSource)
{
_cameraFrameSource = cameraFrameSource;
InitializeComponent();
if (!DesignerProperties.GetIsInDesignMode(this) && _cameraFrameSource != null)
{
_cameraFrameSource.NewFrame += NewFrame;
var cameras = CameraService.AvailableCameras.ToList();
comboBoxCameras.ItemsSource = cameras;
comboBoxCameras.SelectedItem = _cameraFrameSource.Camera;
}
}
private readonly object _frameSync = new object();
private bool _frameWaiting = false;
private void NewFrame(Touchless.Vision.Contracts.IFrameSource frameSource, Touchless.Vision.Contracts.Frame frame, double fps)
{
//We want to ignore frames we can't render fast enough
lock (_frameSync)
{
if (!_frameWaiting)
{
_frameWaiting = true;
Action workAction = delegate
{
this.labelCameraFPSValue.Content = fps.ToString();
this.imgPreview.Source = frame.OriginalImage.ToBitmapSource();
lock (_frameSync)
{
_frameWaiting = false;
}
};
Dispatcher.BeginInvoke(workAction);
}
}
}
private void comboBoxCameras_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
_cameraFrameSource.Camera = comboBoxCameras.SelectedItem as Camera;
panelCameraInfo.Visibility = comboBoxCameras.SelectedItem != null
? Visibility.Visible
: Visibility.Collapsed;
}
private void buttonCameraProperties_Click(object sender, RoutedEventArgs e)
{
_cameraFrameSource.Camera.ShowPropertiesDialog();
}
private void chkLimitFps_Checked(object sender, RoutedEventArgs e)
{
this.txtLimitFps.IsEnabled = true;
updateFPS();
}
private void chkLimitFps_Unchecked(object sender, RoutedEventArgs e)
{
//this.txtLimitFps.Text = "-1";
this.txtLimitFps.Background = Brushes.White;
_cameraFrameSource.Camera.Fps = -1;
this.txtLimitFps.IsEnabled = false;
}
private void txtLimitFps_TextChanged(object sender, TextChangedEventArgs e)
{
updateFPS();
}
private void updateFPS()
{
int fps;
if (int.TryParse(this.txtLimitFps.Text, out fps))
{
_cameraFrameSource.Camera.Fps = fps;
this.txtLimitFps.Background = Brushes.LightGreen;
}
else
{
this.txtLimitFps.Background = Brushes.Red;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace Touchless.Vision.Camera
{
internal static class WebCamLibInterop
{
//[DllImport("WebCamLib.dll", EntryPoint = "Initialize")]
//public static extern int WebCamInitialize();
//[DllImport("WebCamLib.dll", EntryPoint = "Cleanup")]
//public static extern int WebCamCleanup();
//[DllImport("WebCamLib.dll", EntryPoint = "RefreshCameraList")]
//public static extern int WebCamRefreshCameraList(ref int count);
//[DllImport("WebCamLib.dll", EntryPoint = "GetCameraDetails")]
//public static extern int WebCamGetCameraDetails(int index,
// [Out, MarshalAs(UnmanagedType.Interface)] out object nativeInterface,
// out IntPtr name);
public delegate void CaptureCallbackProc(
int dwSize,
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1, SizeParamIndex = 0)] byte[] abData);
//[DllImport("WebCamLib.dll", EntryPoint = "StartCamera")]
//public static extern int WebCamStartCamera(
// [In, MarshalAs(UnmanagedType.Interface)] object nativeInterface,
// CaptureCallbackProc lpCaptureFunc,
// ref int width,
// ref int height
// );
//[DllImport("WebCamLib.dll", EntryPoint = "StopCamera")]
//public static extern int WebCamStopCamera();
//[DllImport("WebCamLib.dll", EntryPoint = "DisplayCameraPropertiesDialog")]
//public static extern int WebCamDisplayCameraPropertiesDialog(
// [In, MarshalAs(UnmanagedType.Interface)] object nativeInterface);
}
}
using System.Drawing;
using System.Runtime.Serialization;
namespace Touchless.Vision.Contracts
{
[DataContract]
public class DetectedObject
{
private static readonly object SyncObject = new object();
private static int _nextId = 1;
public DetectedObject()
{
Id = NextId();
}
[DataMember]
public int Id { get; private set; }
[IgnoreDataMember]
public Bitmap Image { get; set; }
//[DataMember]
//public byte[] ImageData
//{
// get
// {
// byte[] data = null;
// if (this.Image != null)
// {
// MemoryStream memoryStream = new MemoryStream();
// this.Image.Save(memoryStream, ImageFormat.Bmp);
// memoryStream.Flush();
// data = memoryStream.ToArray();
// memoryStream.Close();
// }
// return data;
// }
//}
[DataMember]
public virtual Point Position { get; set; }
public void AssignNewId()
{
Id = NextId();
}
private static int NextId()
{
int result;
lock (SyncObject)
{
result = _nextId;
_nextId++;
}
return result;
}
}
}
\ No newline at end of file
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.Serialization;
namespace Touchless.Vision.Contracts
{
[DataContract]
public class Frame
{
[DataMember]
public int Id { get; set; }
[IgnoreDataMember]
public Bitmap OriginalImage { get; set; }
private Bitmap _image;
[IgnoreDataMember]
public Bitmap Image
{
get
{
if (_image == null)
{
_image = OriginalImage.Clone() as Bitmap;
}
return _image;
}
set { _image = value;}
}
public Frame(Bitmap originalImage)
{
Id = NextId();
OriginalImage = originalImage;
}
[DataMember]
public byte[] ImageData
{
get
{
byte[] data = null;
if (Image != null)
{
var memoryStream = new MemoryStream();
Image.Save(memoryStream, ImageFormat.Png);
memoryStream.Flush();
data = memoryStream.ToArray();
memoryStream.Close();
}
return data;
}
//Setter is only here for serialization purposes
set { }
}
private static readonly object SyncObject = new object();
private static int _nextId = 1;
private static int NextId()
{
int result;
lock (SyncObject)
{
result = _nextId;
_nextId++;
}
return result;
}
}
}
\ No newline at end of file
using System;
namespace Touchless.Vision.Contracts
{
public interface IFrameSource : ITouchlessAddIn
{
event Action<IFrameSource, Frame, double> NewFrame;
void StartFrameCapture();
void StopFrameCapture();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
namespace Touchless.Vision.Contracts
{
public interface IObjectDetector : ITouchlessAddIn
{
event Action<IObjectDetector, DetectedObject, Frame> NewObject;
event Action<IObjectDetector, DetectedObject, Frame> ObjectMoved;
event Action<IObjectDetector, DetectedObject, Frame> ObjectRemoved;
event Action<IObjectDetector, Frame, ReadOnlyCollection<DetectedObject>> FrameProcessed;
ReadOnlyCollection<DetectedObject> DetectObjects(Frame frame);
}
}
using System.Windows;
namespace Touchless.Vision.Contracts
{
public interface ITouchlessAddIn
{
string Name { get; }
string Description { get; }
bool HasConfiguration { get; }
UIElement ConfigurationElement { get; }
}
}
\ No newline at end of file
namespace Touchless.Vision
{
internal class ExportInterfaceNames
{
internal const string DefaultCamera = "Touchless.Camera.CameraService.DefaultCamera";
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Touchless.Vision")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Touchless.Vision")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0788b83f-d2ab-4790-b720-d6b6eb7f5056")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media.Imaging;
using WindowsPoint = System.Windows.Point;
using DrawingPoint = System.Drawing.Point;
namespace Touchless.Shared.Extensions
{
public static class Extensions
{
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> items, Action<T> action)
{
foreach (T item in items)
{
action(item);
}
return items;
}
public static void IfNotNull<T>(this T item, Action<T> action)
{
if (item != null)
{
action(item);
}
}
public static WindowsPoint ToWindowsPoint(this DrawingPoint p)
{
return new WindowsPoint
{
X = p.X,
Y = p.Y
};
}
public static DrawingPoint ToDrawingPoint(this WindowsPoint p)
{
return new DrawingPoint
{
X = (int) p.X,
Y = (int) p.Y
};
}
[DllImport("gdi32")]
private static extern int DeleteObject(IntPtr o);
public static BitmapSource ToBitmapSource(this Bitmap source)
{
BitmapSource bs = null;
IntPtr ip = source.GetHbitmap();
try
{
bs = Imaging.CreateBitmapSourceFromHBitmap(ip, IntPtr.Zero, Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions());
}
finally
{
DeleteObject(ip);
}
return bs;
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{CC5D5149-0092-4508-AC34-2ABE1468A1C9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Touchless.Vision</RootNamespace>
<AssemblyName>Touchless.Vision</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition, Version=2009.1.23.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>!ref\System.ComponentModel.Composition.dll</HintPath>
</Reference>
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WebCamLib, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\WebCamLib\bin\Debug\WebCamLib.dll</HintPath>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Camera\Camera.cs" />
<Compile Include="Camera\CameraFrameSource.cs" />
<Compile Include="Camera\CameraService.cs" />
<Compile Include="Camera\Configuration\CameraFrameSourceConfigurationElement.xaml.cs">
<DependentUpon>CameraFrameSourceConfigurationElement.xaml</DependentUpon>
</Compile>
<Compile Include="Camera\WebCamLibInterop.cs" />
<Compile Include="Contracts\DetectedObject.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Contracts\Frame.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Contracts\IFrameSource.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Contracts\IObjectDetector.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Contracts\ITouchlessAddIn.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ExportInterfaceNames.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Shared\Extensions\Extensions.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="Camera\Configuration\CameraFrameSourceConfigurationElement.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
#pragma checksum "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1B8E89727E3F15204EF7A69E79BC804F"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace Touchless.Vision.Camera.Configuration {
/// <summary>
/// CameraFrameSourceConfigurationElement
/// </summary>
public partial class CameraFrameSourceConfigurationElement : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 8 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox comboBoxCameras;
#line default
#line hidden
#line 9 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.StackPanel panelCameraInfo;
#line default
#line hidden
#line 10 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button buttonCameraProperties;
#line default
#line hidden
#line 15 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Label labelCameraFPSValue;
#line default
#line hidden
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox chkLimitFps;
#line default
#line hidden
#line 19 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtLimitFps;
#line default
#line hidden
#line 23 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Image imgPreview;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/Touchless.Vision;component/camera/configuration/cameraframesourceconfigurationel" +
"ement.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.comboBoxCameras = ((System.Windows.Controls.ComboBox)(target));
#line 8 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.comboBoxCameras.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBoxCameras_SelectionChanged);
#line default
#line hidden
return;
case 2:
this.panelCameraInfo = ((System.Windows.Controls.StackPanel)(target));
return;
case 3:
this.buttonCameraProperties = ((System.Windows.Controls.Button)(target));
#line 10 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.buttonCameraProperties.Click += new System.Windows.RoutedEventHandler(this.buttonCameraProperties_Click);
#line default
#line hidden
return;
case 4:
this.labelCameraFPSValue = ((System.Windows.Controls.Label)(target));
return;
case 5:
this.chkLimitFps = ((System.Windows.Controls.CheckBox)(target));
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.chkLimitFps.Checked += new System.Windows.RoutedEventHandler(this.chkLimitFps_Checked);
#line default
#line hidden
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.chkLimitFps.Unchecked += new System.Windows.RoutedEventHandler(this.chkLimitFps_Unchecked);
#line default
#line hidden
return;
case 6:
this.txtLimitFps = ((System.Windows.Controls.TextBox)(target));
#line 19 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.txtLimitFps.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtLimitFps_TextChanged);
#line default
#line hidden
return;
case 7:
this.imgPreview = ((System.Windows.Controls.Image)(target));
return;
}
this._contentLoaded = true;
}
}
}
#pragma checksum "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1B8E89727E3F15204EF7A69E79BC804F"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace Touchless.Vision.Camera.Configuration {
/// <summary>
/// CameraFrameSourceConfigurationElement
/// </summary>
public partial class CameraFrameSourceConfigurationElement : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 8 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox comboBoxCameras;
#line default
#line hidden
#line 9 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.StackPanel panelCameraInfo;
#line default
#line hidden
#line 10 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button buttonCameraProperties;
#line default
#line hidden
#line 15 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Label labelCameraFPSValue;
#line default
#line hidden
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox chkLimitFps;
#line default
#line hidden
#line 19 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtLimitFps;
#line default
#line hidden
#line 23 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Image imgPreview;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/Touchless.Vision;component/camera/configuration/cameraframesourceconfigurationel" +
"ement.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.comboBoxCameras = ((System.Windows.Controls.ComboBox)(target));
#line 8 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.comboBoxCameras.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBoxCameras_SelectionChanged);
#line default
#line hidden
return;
case 2:
this.panelCameraInfo = ((System.Windows.Controls.StackPanel)(target));
return;
case 3:
this.buttonCameraProperties = ((System.Windows.Controls.Button)(target));
#line 10 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.buttonCameraProperties.Click += new System.Windows.RoutedEventHandler(this.buttonCameraProperties_Click);
#line default
#line hidden
return;
case 4:
this.labelCameraFPSValue = ((System.Windows.Controls.Label)(target));
return;
case 5:
this.chkLimitFps = ((System.Windows.Controls.CheckBox)(target));
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.chkLimitFps.Checked += new System.Windows.RoutedEventHandler(this.chkLimitFps_Checked);
#line default
#line hidden
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.chkLimitFps.Unchecked += new System.Windows.RoutedEventHandler(this.chkLimitFps_Unchecked);
#line default
#line hidden
return;
case 6:
this.txtLimitFps = ((System.Windows.Controls.TextBox)(target));
#line 19 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.txtLimitFps.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtLimitFps_TextChanged);
#line default
#line hidden
return;
case 7:
this.imgPreview = ((System.Windows.Controls.Image)(target));
return;
}
this._contentLoaded = true;
}
}
}
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\bin\Debug\Touchless.Vision.dll
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\bin\Debug\Touchless.Vision.pdb
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\bin\Debug\System.ComponentModel.Composition.dll
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\bin\Debug\WebCamLib.dll
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\bin\Debug\WebCamLib.pdb
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\obj\Debug\WebCamWrapper.csprojResolveAssemblyReference.cache
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\obj\Debug\Camera\Configuration\CameraFrameSourceConfigurationElement.baml
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\obj\Debug\Camera\Configuration\CameraFrameSourceConfigurationElement.g.cs
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\obj\Debug\Touchless.Vision_MarkupCompile.cache
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\obj\Debug\Touchless.Vision.g.resources
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\obj\Debug\Touchless.Vision.dll
L:\csharpWebCam-master\csharpWebCam-master\WebCamWrapper\obj\Debug\Touchless.Vision.pdb
#pragma checksum "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1B8E89727E3F15204EF7A69E79BC804F"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace Touchless.Vision.Camera.Configuration {
/// <summary>
/// CameraFrameSourceConfigurationElement
/// </summary>
public partial class CameraFrameSourceConfigurationElement : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 8 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox comboBoxCameras;
#line default
#line hidden
#line 9 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.StackPanel panelCameraInfo;
#line default
#line hidden
#line 10 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button buttonCameraProperties;
#line default
#line hidden
#line 15 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Label labelCameraFPSValue;
#line default
#line hidden
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox chkLimitFps;
#line default
#line hidden
#line 19 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtLimitFps;
#line default
#line hidden
#line 23 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Image imgPreview;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/Touchless.Vision;component/camera/configuration/cameraframesourceconfigurationel" +
"ement.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.comboBoxCameras = ((System.Windows.Controls.ComboBox)(target));
#line 8 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.comboBoxCameras.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBoxCameras_SelectionChanged);
#line default
#line hidden
return;
case 2:
this.panelCameraInfo = ((System.Windows.Controls.StackPanel)(target));
return;
case 3:
this.buttonCameraProperties = ((System.Windows.Controls.Button)(target));
#line 10 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.buttonCameraProperties.Click += new System.Windows.RoutedEventHandler(this.buttonCameraProperties_Click);
#line default
#line hidden
return;
case 4:
this.labelCameraFPSValue = ((System.Windows.Controls.Label)(target));
return;
case 5:
this.chkLimitFps = ((System.Windows.Controls.CheckBox)(target));
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.chkLimitFps.Checked += new System.Windows.RoutedEventHandler(this.chkLimitFps_Checked);
#line default
#line hidden
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.chkLimitFps.Unchecked += new System.Windows.RoutedEventHandler(this.chkLimitFps_Unchecked);
#line default
#line hidden
return;
case 6:
this.txtLimitFps = ((System.Windows.Controls.TextBox)(target));
#line 19 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.txtLimitFps.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtLimitFps_TextChanged);
#line default
#line hidden
return;
case 7:
this.imgPreview = ((System.Windows.Controls.Image)(target));
return;
}
this._contentLoaded = true;
}
}
}
#pragma checksum "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1B8E89727E3F15204EF7A69E79BC804F"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace Touchless.Vision.Camera.Configuration {
/// <summary>
/// CameraFrameSourceConfigurationElement
/// </summary>
public partial class CameraFrameSourceConfigurationElement : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 8 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox comboBoxCameras;
#line default
#line hidden
#line 9 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.StackPanel panelCameraInfo;
#line default
#line hidden
#line 10 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button buttonCameraProperties;
#line default
#line hidden
#line 15 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Label labelCameraFPSValue;
#line default
#line hidden
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox chkLimitFps;
#line default
#line hidden
#line 19 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtLimitFps;
#line default
#line hidden
#line 23 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Image imgPreview;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/Touchless.Vision;component/camera/configuration/cameraframesourceconfigurationel" +
"ement.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.comboBoxCameras = ((System.Windows.Controls.ComboBox)(target));
#line 8 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.comboBoxCameras.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBoxCameras_SelectionChanged);
#line default
#line hidden
return;
case 2:
this.panelCameraInfo = ((System.Windows.Controls.StackPanel)(target));
return;
case 3:
this.buttonCameraProperties = ((System.Windows.Controls.Button)(target));
#line 10 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.buttonCameraProperties.Click += new System.Windows.RoutedEventHandler(this.buttonCameraProperties_Click);
#line default
#line hidden
return;
case 4:
this.labelCameraFPSValue = ((System.Windows.Controls.Label)(target));
return;
case 5:
this.chkLimitFps = ((System.Windows.Controls.CheckBox)(target));
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.chkLimitFps.Checked += new System.Windows.RoutedEventHandler(this.chkLimitFps_Checked);
#line default
#line hidden
#line 18 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.chkLimitFps.Unchecked += new System.Windows.RoutedEventHandler(this.chkLimitFps_Unchecked);
#line default
#line hidden
return;
case 6:
this.txtLimitFps = ((System.Windows.Controls.TextBox)(target));
#line 19 "..\..\..\..\Camera\Configuration\CameraFrameSourceConfigurationElement.xaml"
this.txtLimitFps.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtLimitFps_TextChanged);
#line default
#line hidden
return;
case 7:
this.imgPreview = ((System.Windows.Controls.Image)(target));
return;
}
this._contentLoaded = true;
}
}
}
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\bin\Release\Touchless.Vision.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\bin\Release\Touchless.Vision.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\bin\Release\System.ComponentModel.Composition.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\bin\Release\WebCamLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\bin\Release\WebCamLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\obj\Release\Camera\Configuration\CameraFrameSourceConfigurationElement.baml
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\obj\Release\Camera\Configuration\CameraFrameSourceConfigurationElement.g.cs
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\obj\Release\Touchless.Vision_MarkupCompile.cache
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\obj\Release\Touchless.Vision.g.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\obj\Release\Touchless.Vision.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\obj\Release\Touchless.Vision.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\WebCamWrapper\obj\Release\WebCamWrapper.csprojResolveAssemblyReference.cache
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!