Commit f8150914 by Tapio Haapala

Uusi moya signup

1 parent 9595c474
Showing with 5934 additions and 1249 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)
{
}
}
......
......@@ -143,47 +143,47 @@
<data name="toolStripRefreshButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAk2SURBVFhHtVYJVJNXFjZBUSQhIgrEDWxRC25TFcom0Yhs
QQkYlJiEhCBoocgmIKhYHGrVUkfrjCODHdfK1JZqWMSNugAKooCKgBUEUZTFBa2govab98KvrQeonk7n
O+eeP/n/+9793r3fu+/1+aPwybM0m39yvLVfwWS5qnCatfKEYBDz6f8H52xTS5ejw9e7541qFBeYQXLO
HPMvjsTC0rFQlXwI9blp90PLHHeFX3C2ZIb8ORBqjE0cc4wyXE4NhXelAaRNupC2sDG/iQ3JbTbm3WLD
u4FYnS4WVg9H6GVbRF0SfhNX5mrOTPGHwbI9yPO2y+G1iq8YIOCRLvzb+kF2TwfS1l8J+DAExPVseNUR
u86G6up7iLw0uzH2ovtEZq7fBUuUz/V3zR3IZ/5TsBw0PB/rbM4L2S19LGofAPXP/RHwcABC24YjuW0W
/vVwMfY8jMP2B0uxpsUD6puj4H29H7xqCYkaNpRXzRBdNet+QpnIhpmzZwQHB/ebW8CFSx6nY1auoR15
xXI6MGi6tYbzxP82B0ueDkRwhx7C2/nY0jEfp9p3Y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XKlDlztnT
lcXTri4udsjoj4BaC6Q+nIC0qTbKMv2ru5rjkN74N4SfEWJ2vgHsskjgLDZss4nlsmF/iA2HY2y4FnKw
sGIytjVHY0fdajjn8bs9fxi3XKFQGNB60+xSjdHWzhDqf2tTNasFuXHWeHmx4emEy9NxsGUTsq99jY2X
IrHivBTRJR6ILHFFcrkEG2rDyPetyL+5DykVwRBkGV4RbZ3i+uoWRaZUa4bOS8nQ4HSh9F2/YJzV9zzF
dx/4+BUNPx5YaoGUKgk2X4nE/sYN2Fe/AVtqkrCyTEVq/T6mZ+mXCdNHJvvH+pjRlDOrfNd23huUJdWE
un5KpbF0+1QH76yRUZ7Zxmtd8oamz8oy+I/jd4ZbHNP5yW4bpjqQrI2gq6YHHF0AM83/DHWDoamkZaH1
owcXrSW1wMDA4TQo/UbJ0lrTMT1D/2QwAh1AU0ue9JhW15MGfWtNe0FD47/EXw//W2j7xgAAAABJRU5E
rkJggg==
</value>
</data>
<data name="UnlockToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
......@@ -214,53 +214,53 @@
<data name="usersToolStripPrintButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALtSURBVDhPjZJ7SBNQGMVnRNkijGJFlEj0tqi0MmtTcjQp
51L3yGwzSip1c9oy5pqbutKZOnPOZS73aLY1H5iv1GXWVJRekCgVRRRERi8Jw+xl7bS2/VMg+IMP7r3n
Owfudy9hKgICAtaRyWRTyJaQXn9//7Ouo9keZZpw91DYRZlHkRgVBqLvbFcRZV5petQrkvm/B4z4daMY
fHoo5szy1Xul6WEQsY9Mtiow2ZiFphMx34hEYrBX+peVmykk5kn5yVUU2nbXdkYE//SxIBY3SZHM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qsLxmEdR7rWz277q+A/vqyGefT916Pj+B8X976d48nodW16HAmXcckeS93xv/HkUCQ/rhAqFjibRjJ7m
xWfuc/Vy11s3GwJsyGSryneTutovc6ge/4XyTzPIUhegS2WLkcLdqEu2wLyWgJleK8SXS8FQtiOwohs0
sWbKys7B0RAiHZmYkI39QOGbSeSNfEP266/IGBqHqKEVpSou+mX7Ma02waDKCb65laBKNLggfYxd9s6+
hgBRx3BrxovPSB74iATtB8Q8HUOsvmJ63iK6cxSR7cMIf6hBYsZNeAnzcCapAMej02f1n8XcEMDOr0qP
bBsGt/kVOE1DuFn/HEGP+nFZ3YuAqqcIqOjBpfIusCu6cDJMAHLkXRykBtYazCt4hScwg6p7cUXfwFC2
gV72BHR5C2gPmuEvawRN1mRYMxVt8OAJcYorxE47B5bRrn+JgGskVmX3wsqA6GWtq8bSRsPAmKoOXCyu
g19hreHe7tx42PqFLVpYWFga7QQCk8k0zSxR8iNkmpeBYvUcNU8NX3EFqPmPwKnV4lZNH1iKFpy7pwD5
lgAHvP17jNY1bOLz+Za5uVKXtGKViCdRDPhkl81SkqSgpBSBcb8clOQCuIbGYM8xt9tGz7qYBAcHbxOL
851SpfIYbk7Js/NJkmnPO+nwiEjUeVHpR4x9G8KEzWZvzcmR2GcUyiNEktI0gUCwY1UiEP4BaBZ+C/aV
acAAAAAASUVORK5CYII=
</value>
</data>
<data name="cardLocationInputToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAZNSURBVFhH7Zd5VI1pHMczc0xzOHNEg4opa5sMbVRktDC0
DBqppBK3puxFmhZpI0W2MmlDUtQIpT25clORpYiIxC1DlsluMsZ3fu/rluq+ujOO+W+ecz6nt3tv7+f7
/L73ufck9f/60NINOOqi45jQr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C
</value>
</data>
<data name="incomingFormToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
......@@ -281,69 +281,69 @@
<data name="cardInfoToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAL1SURBVDhPdVNbSBRhFB6xpV5MxCIfytVxd10vq5tlpuYl
1NRZ9+p6v6SppGmWlSEEGqbrzLqu6+YlWzWrl6SnIIIearuQkJAYZRQGopWPwhLsy4Knc8YLSXTgg2HO
933/me8/w+yqjK49oRyfEsZZRsM1/KKUE34T6JneUY84W+zdFakTAsK4vna5zrqiLuE3kquHIfnsCCRW
OkFd4oAo460NmVZYYZFD3C3ZZkkzuvaxmr6eaE2vN/3cGOQ3T0LuhQnQXJyCvOYJSEGjY+VDEGseAEVu
t5e4pNmSMwyrtZRFG3lPduNd0F+eFg24lkl49PwjPHv9CdJrHJBQNgRxRYM4iQ0i9byHNKI4JK/3oNwg
uNNqx8DQdh8KWu+Jp+c2TcDIzCxMPn4FSaV9EF88iBPYIdLQDwq9FeRawU1ahtVYOLXJvq5FIRlwLVOQ
WT8OqTWj4icYL0+B0iCATGcFzAAiCngRcqNtndUIHIONjqPVwz4aPafJJY4q0wlQ0zkDC9/W4Kl7AZTa
bpDm9wGGvAPWZPMpUIvpW3k6jcKj8agpzbfACUz/3cIyvJn7AlEFXf8YxBQOIN/KM0qDtSOqxOGLwPG2
m0SmsF68//5fA5l5wKcw4ARyvcDFYQYsftffBDrh5dymQbTuJuAyITZ7lAFpSCvegrpowB1tskE4OeMk
Cn0/JFY44e38MszOf4XEYotoSFPhoom3oUKNeAtUSoOtTGUSPKoiatjFIFuFJ/B5aQ0Wl37AFX4Gkioc
cLzcKRonVd32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ME6pvrNJGkFMRVuVUOzsO13n9p7BMClQupXy64jOaTBc9kB24yjkNHkgq37MS9w9m0gVivudaBzo
xB1Y07S5fbQTRVcfQPG1h2BEcB1jvrON42tK5BDXL9utAISICZEEH0u/kBun6x5Pq7Z/yK4f+pnZ4PyV
XskvxGtveMJO1RcwweEhyKXTA0m4U/SLkusRhJgRiZSBByPyRIcUJlGovCowKFyN/knYkyKOIshkP8Mw
AX8Aq0epojIVu3gAAAAASUVORK5CYII=
</value>
</data>
<data name="cloackRoomToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAWNSURBVFhH7ZZ5TFRXGMVv1zTpmnSxVkRUCggIA1jAUgGX
gsgioDCAIAjD4IA4BRxXBBFF0yIuiAqjgASUIrghoCLUWncMidXaxHSLdo8hbZr+fXrP80mxwTc25c++
5HD5vvud87uzP/H/9bhXf4l/UOq0N7/PDXOAluqyJ3/BWdU2cleHweOnSr0zErzeQLzn68Mq570xOLVU
B86qtpG7dsU5wZrogiXT7BDs+AoCxr/8kNhbOWucMsNZ1TZy1/pwR5RFvo3VIRMeGc49znBWbT3edWWJ
V+HpTA+cMtxXW7oLPinwxOU1U3C1yBc6ne4hdZu8h9U/5+hlBrOY+SCfLDJVvBB3V/vjt/ZV+LOvUdHX
J7bibGUuvjxtRf+hjeg7UKzU7D+YeZQex0sWmSpeiJsFUzBwfCX+uGjF759W4ceucuzJm4uLDcvQuyUD
nZtSlZp97mvJlpcMsshU8UJcyPbEvWMrMHCmHPc61uNuWyGWRvngUt1idJfp0VUap9Tsc19LtrwKQ7LI
VPFCdBsn45fDFvzavg4/t1rwbZMZ9eZZuFiTilPr5qKzKEqp2ee+lmx5ySCLTBUvxEn5pvihtUDKgjuN
JtzeZ0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I+UjZS/1ktQzUsqfF6Rek+JBJkk5STmPoJjHXOa/
LkXes0KIUX8BLJtZYb+Zf84AAAAASUVORK5CYII=
</value>
</data>
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMLSURBVDhPdVJrLJthGPV/+7Mt+7Nlkllm2CzZZqy2bIaN
0WI2lxmpYqWUNnaLFh2GCV9pP63L0vLpNpcg1dHafhBS2SWEBc0WVtkqiEuWhV3EOPNRkQ0neX+8Oc9z
3vOc57XZgELdfoik9EI5pTcUqrXTBWXN01nyOoOI0AhTc9SHrGXbg6QMDHmNXlvU2gSyrx5yUyVko1lI
6QwCp5gAP1OhjblXzLCW/wv6ZbpZ3CZF/qc06Gc70fvTjIT6dBR8vA9Okxe8c2S4zc/VBvLEW53QttNq
VIh5cxbKsYcwzBrxfn4Qw79m8GJci+jSbHiUDuN87iP4sx8IrW2boGeOlD4Htz0YWaYIPP1CQG3JBjmg
BldThzjFHEILxuBYGYAroQKDtW0TdGAJpBnB5bFg93gg8Z03klV3wavSI1bxAdFF43AlNThSfRUXA+Kn
rW2boNMWqJYQkSnBZcodni+DES4jkFg6jhjpBMJyR3BUzYZtmTtcWdsI0Kvil8+BVzaFUGEkvJWRONcY
AUY1iVu5ZgRlDMKLx8SJh5dwxpezdQQRQQkFRBfuKBfBIUbhfy8ep6ggOGr8cEyeDp8HvXDnJeJCSDhc
fDlbQ6Q/Cb3nuEITkohXSFPW4n6xGlEiKeyeuMEtgQcWl0CypOKrhGyZEBF1ltQ8iuKKFCyrxKqLolpx
habz98CncSz8XMHUt0W0dHwAX6ICM16CstpO/M8JcionfaMyQ9YEspUtOpN5Gkli+ecDp/3m7X3ZS3kV
rctqbS8Kq3r+NLwehLLa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kGsRDG275TX/GFPznJuWesK
pe3FY6r7V/3rIagqDPP7z9ww2rvzhsWFz7rUDQawrse3rAtIVY0LKwB22F4bt3Pl2pXX9/Strt3nvgOm
6SX0ffiGzoEv2H2cTdyMK7CTkM3jnf1TOMiKWFgXSHtS32LoN63NWdoVKMgfTpc3De864LO884gHNo+D
a9jkJveksr3rYWkrbByDNxwk5FUFiouqp6pb3qKr34w2wxjS5Y1w9hNOeYdLZf/j9jr4bmTAICguj+3B
SadZbJHZ1o1jtnEKpvec8FlP+v+cldVvOdP0dvr/PnsAAAAASUVORK5CYII=
</value>
</data>
<data name="orgMealToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
......
......@@ -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;
}
}
}
......
......@@ -29,331 +29,33 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.label10 = new System.Windows.Forms.Label();
this.cmbGender = new System.Windows.Forms.ComboBox();
this.txtPhone = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.txtCity = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtAge = new System.Windows.Forms.TextBox();
this.txtZip = new System.Windows.Forms.TextBox();
this.txtAdress = new System.Windows.Forms.TextBox();
this.txtEmail = new System.Windows.Forms.TextBox();
this.txtNick = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.btnClear = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnTakePic = new System.Windows.Forms.Button();
this.pbIncoming = new System.Windows.Forms.PictureBox();
this.btnFinnish = new System.Windows.Forms.Button();
this.btnEnglish = new System.Windows.Forms.Button();
this.lblMessage = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).BeginInit();
this.userDetailsEditor1 = new RamaSignup.UserDetailsEditor();
this.userLoginControl1 = new RamaSignup.UserLoginControl();
this.SuspendLayout();
//
// label10
//
this.label10.AutoSize = true;
this.label10.BackColor = System.Drawing.Color.Transparent;
this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label10.Location = new System.Drawing.Point(277, 87);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(60, 16);
this.label10.TabIndex = 73;
this.label10.Text = "Gender";
//
// cmbGender
//
this.cmbGender.BackColor = System.Drawing.SystemColors.Window;
this.cmbGender.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbGender.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cmbGender.FormattingEnabled = true;
this.cmbGender.Items.AddRange(new object[] {
"I don\'t know",
"Male",
"Female"});
this.cmbGender.Location = new System.Drawing.Point(280, 105);
this.cmbGender.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.cmbGender.Name = "cmbGender";
this.cmbGender.Size = new System.Drawing.Size(125, 28);
this.cmbGender.TabIndex = 4;
this.cmbGender.SelectedIndexChanged += new System.EventHandler(this.cmbGender_SelectedIndexChanged);
//
// txtPhone
//
this.txtPhone.BackColor = System.Drawing.SystemColors.Window;
this.txtPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtPhone.Location = new System.Drawing.Point(411, 106);
this.txtPhone.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtPhone.Name = "txtPhone";
this.txtPhone.Size = new System.Drawing.Size(138, 26);
this.txtPhone.TabIndex = 5;
this.txtPhone.TextChanged += new System.EventHandler(this.txtPhone_TextChanged);
//
// label9
//
this.label9.AutoSize = true;
this.label9.BackColor = System.Drawing.Color.Transparent;
this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label9.Location = new System.Drawing.Point(408, 87);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(53, 16);
this.label9.TabIndex = 71;
this.label9.Text = "Phone";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtCity
//
this.txtCity.BackColor = System.Drawing.SystemColors.Window;
this.txtCity.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtCity.Location = new System.Drawing.Point(280, 271);
this.txtCity.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtCity.Name = "txtCity";
this.txtCity.Size = new System.Drawing.Size(125, 26);
this.txtCity.TabIndex = 9;
this.txtCity.TextChanged += new System.EventHandler(this.txtCity_TextChanged);
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label8.Location = new System.Drawing.Point(277, 252);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(36, 16);
this.label8.TabIndex = 70;
this.label8.Text = "City";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label7
//
this.label7.AutoSize = true;
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(143, 87);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(95, 16);
this.label7.TabIndex = 69;
this.label7.Text = "Date of birth";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label6.Location = new System.Drawing.Point(143, 252);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(31, 16);
this.label6.TabIndex = 68;
this.label6.Text = "Zip";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(143, 197);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(112, 16);
this.label5.TabIndex = 67;
this.label5.Text = "Street address";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// 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(143, 142);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(55, 16);
this.label4.TabIndex = 66;
this.label4.Text = "E-Mail";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtAge
//
this.txtAge.BackColor = System.Drawing.SystemColors.Window;
this.txtAge.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtAge.Location = new System.Drawing.Point(146, 106);
this.txtAge.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtAge.Name = "txtAge";
this.txtAge.Size = new System.Drawing.Size(128, 26);
this.txtAge.TabIndex = 3;
this.txtAge.TextChanged += new System.EventHandler(this.txtAge_TextChanged);
//
// txtZip
//
this.txtZip.BackColor = System.Drawing.SystemColors.Window;
this.txtZip.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtZip.Location = new System.Drawing.Point(146, 271);
this.txtZip.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtZip.Name = "txtZip";
this.txtZip.Size = new System.Drawing.Size(128, 26);
this.txtZip.TabIndex = 8;
this.txtZip.TextChanged += new System.EventHandler(this.txtZip_TextChanged);
//
// txtAdress
//
this.txtAdress.BackColor = System.Drawing.SystemColors.Window;
this.txtAdress.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtAdress.Location = new System.Drawing.Point(146, 216);
this.txtAdress.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtAdress.Name = "txtAdress";
this.txtAdress.Size = new System.Drawing.Size(403, 26);
this.txtAdress.TabIndex = 7;
this.txtAdress.TextChanged += new System.EventHandler(this.txtAdress_TextChanged);
//
// 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(146, 161);
this.txtEmail.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtEmail.Name = "txtEmail";
this.txtEmail.Size = new System.Drawing.Size(403, 26);
this.txtEmail.TabIndex = 6;
this.txtEmail.TextChanged += new System.EventHandler(this.txtEmail_TextChanged);
//
// txtNick
//
this.txtNick.BackColor = System.Drawing.SystemColors.Window;
this.txtNick.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtNick.Location = new System.Drawing.Point(146, 51);
this.txtNick.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtNick.MaxLength = 12;
this.txtNick.Name = "txtNick";
this.txtNick.Size = new System.Drawing.Size(128, 26);
this.txtNick.TabIndex = 2;
this.txtNick.TextChanged += new System.EventHandler(this.txtNick_TextChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(143, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(40, 16);
this.label2.TabIndex = 59;
this.label2.Text = "Nick";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(277, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(82, 16);
this.label1.TabIndex = 56;
this.label1.Text = "First name";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtName
//
this.txtName.BackColor = System.Drawing.SystemColors.Window;
this.txtName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtName.Location = new System.Drawing.Point(280, 51);
this.txtName.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(125, 26);
this.txtName.TabIndex = 1;
this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged);
//
// btnClear
//
this.btnClear.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnClear.Location = new System.Drawing.Point(841, 258);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(181, 35);
this.btnClear.TabIndex = 74;
this.btnClear.Text = "Clear";
this.btnClear.UseVisualStyleBackColor = true;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// btnSave
//
this.btnSave.Enabled = false;
this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold);
this.btnSave.Location = new System.Drawing.Point(841, 299);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(181, 36);
this.btnSave.TabIndex = 11;
this.btnSave.Text = "Save";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// 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(841, 216);
this.btnTakePic.Name = "btnTakePic";
this.btnTakePic.Size = new System.Drawing.Size(181, 36);
this.btnTakePic.TabIndex = 0;
this.btnTakePic.Text = "Use this picture";
this.btnTakePic.UseVisualStyleBackColor = true;
this.btnTakePic.Click += new System.EventHandler(this.btnTakePic_Click);
//
// pbIncoming
//
this.pbIncoming.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbIncoming.Location = new System.Drawing.Point(555, 12);
this.pbIncoming.Name = "pbIncoming";
this.pbIncoming.Size = new System.Drawing.Size(280, 410);
this.pbIncoming.TabIndex = 78;
this.pbIncoming.TabStop = false;
//
// btnFinnish
//
this.btnFinnish.Image = ((System.Drawing.Image)(resources.GetObject("btnFinnish.Image")));
this.btnFinnish.Location = new System.Drawing.Point(854, 73);
this.btnFinnish.Location = new System.Drawing.Point(784, 14);
this.btnFinnish.Name = "btnFinnish";
this.btnFinnish.Size = new System.Drawing.Size(128, 63);
this.btnFinnish.TabIndex = 80;
this.btnFinnish.UseVisualStyleBackColor = true;
this.btnFinnish.Click += new System.EventHandler(this.btnFinnish_Click);
this.btnFinnish.Visible = false;
//
// btnEnglish
//
this.btnEnglish.Image = ((System.Drawing.Image)(resources.GetObject("btnEnglish.Image")));
this.btnEnglish.Location = new System.Drawing.Point(854, 142);
this.btnEnglish.Location = new System.Drawing.Point(918, 12);
this.btnEnglish.Name = "btnEnglish";
this.btnEnglish.Size = new System.Drawing.Size(128, 65);
this.btnEnglish.TabIndex = 81;
this.btnEnglish.UseVisualStyleBackColor = true;
this.btnEnglish.Click += new System.EventHandler(this.btnEnglish_Click);
//
// lblMessage
//
this.lblMessage.BackColor = System.Drawing.Color.Transparent;
this.lblMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMessage.Location = new System.Drawing.Point(26, 431);
this.lblMessage.Name = "lblMessage";
this.lblMessage.Size = new System.Drawing.Size(969, 73);
this.lblMessage.TabIndex = 84;
this.lblMessage.Text = "label3";
this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblMessage.Click += new System.EventHandler(this.lbMessage_Click);
this.btnEnglish.Visible = false;
//
// panel1
//
......@@ -362,100 +64,11 @@
this.panel1.Size = new System.Drawing.Size(1, 1);
this.panel1.TabIndex = 86;
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.SystemColors.Window;
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox1.Location = new System.Drawing.Point(414, 51);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(135, 26);
this.textBox1.TabIndex = 87;
//
// label11
//
this.label11.AutoSize = true;
this.label11.BackColor = System.Drawing.Color.Transparent;
this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label11.Location = new System.Drawing.Point(411, 32);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(81, 16);
this.label11.TabIndex = 88;
this.label11.Text = "Last name";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox2
//
this.textBox2.BackColor = System.Drawing.SystemColors.Window;
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox2.Location = new System.Drawing.Point(146, 333);
this.textBox2.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(128, 26);
this.textBox2.TabIndex = 89;
//
// label12
//
this.label12.AutoSize = true;
this.label12.BackColor = System.Drawing.Color.Transparent;
this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label12.Location = new System.Drawing.Point(143, 307);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(80, 16);
this.label12.TabIndex = 90;
this.label12.Text = "Username";
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label13
//
this.label13.AutoSize = true;
this.label13.BackColor = System.Drawing.Color.Transparent;
this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label13.Location = new System.Drawing.Point(277, 307);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(77, 16);
this.label13.TabIndex = 91;
this.label13.Text = "Password";
this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label13.Click += new System.EventHandler(this.label13_Click);
//
// textBox3
//
this.textBox3.BackColor = System.Drawing.SystemColors.Window;
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox3.Location = new System.Drawing.Point(280, 333);
this.textBox3.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(125, 26);
this.textBox3.TabIndex = 92;
//
// textBox4
//
this.textBox4.BackColor = System.Drawing.SystemColors.Window;
this.textBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox4.Location = new System.Drawing.Point(411, 333);
this.textBox4.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(138, 26);
this.textBox4.TabIndex = 93;
//
// label14
//
this.label14.AutoSize = true;
this.label14.BackColor = System.Drawing.Color.Transparent;
this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label14.Location = new System.Drawing.Point(408, 307);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(121, 16);
this.label14.TabIndex = 94;
this.label14.Text = "Password again";
this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(1012, 758);
this.button1.Location = new System.Drawing.Point(1046, 758);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(10, 10);
this.button1.TabIndex = 95;
......@@ -463,48 +76,40 @@
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// userDetailsEditor1
//
this.userDetailsEditor1.BackColor = System.Drawing.Color.Transparent;
this.userDetailsEditor1.Location = new System.Drawing.Point(3, 83);
this.userDetailsEditor1.Name = "userDetailsEditor1";
this.userDetailsEditor1.Size = new System.Drawing.Size(1043, 673);
this.userDetailsEditor1.TabIndex = 98;
this.userDetailsEditor1.Visible = false;
this.userDetailsEditor1.CloseView += new System.EventHandler(this.userDetailsEditor1_CloseView);
this.userDetailsEditor1.Load += new System.EventHandler(this.userDetailsEditor1_Load);
//
// userLoginControl1
//
this.userLoginControl1.BackColor = System.Drawing.Color.Transparent;
this.userLoginControl1.Location = new System.Drawing.Point(340, 222);
this.userLoginControl1.Name = "userLoginControl1";
this.userLoginControl1.Size = new System.Drawing.Size(507, 174);
this.userLoginControl1.TabIndex = 97;
this.userLoginControl1.LoginOk += new System.EventHandler(this.userLoginControl1_LoginOk);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::RamaSignup.Properties.Resources.vecto_tausta;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1024, 768);
this.ClientSize = new System.Drawing.Size(1058, 768);
this.Controls.Add(this.userDetailsEditor1);
this.Controls.Add(this.userLoginControl1);
this.Controls.Add(this.button1);
this.Controls.Add(this.label14);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.label13);
this.Controls.Add(this.label12);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label11);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.lblMessage);
this.Controls.Add(this.btnEnglish);
this.Controls.Add(this.btnFinnish);
this.Controls.Add(this.pbIncoming);
this.Controls.Add(this.btnTakePic);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.btnClear);
this.Controls.Add(this.label10);
this.Controls.Add(this.cmbGender);
this.Controls.Add(this.txtPhone);
this.Controls.Add(this.label9);
this.Controls.Add(this.txtCity);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.txtAge);
this.Controls.Add(this.txtZip);
this.Controls.Add(this.txtAdress);
this.Controls.Add(this.txtEmail);
this.Controls.Add(this.txtNick);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtName);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form1";
this.Text = "Form1";
......@@ -515,49 +120,18 @@
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp);
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label10;
private System.Windows.Forms.ComboBox cmbGender;
private System.Windows.Forms.TextBox txtPhone;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtCity;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtAge;
private System.Windows.Forms.TextBox txtZip;
private System.Windows.Forms.TextBox txtAdress;
private System.Windows.Forms.TextBox txtEmail;
private System.Windows.Forms.TextBox txtNick;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnTakePic;
private System.Windows.Forms.PictureBox pbIncoming;
private System.Windows.Forms.Button btnFinnish;
private System.Windows.Forms.Button btnEnglish;
private System.Windows.Forms.Label lblMessage;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Button button1;
private UserLoginControl userLoginControl1;
private UserDetailsEditor userDetailsEditor1;
}
}
......@@ -12,6 +12,7 @@ using NpgsqlAltPool;
using DynamicPg;
using Npgsql;
using System.IO;
using MoyaAdminLib;
namespace RamaSignup
{
......@@ -19,6 +20,10 @@ namespace RamaSignup
{
public Form1()
{
RestClient.ApiApplicationKey = Properties.Settings.Default.ApiApplicationKey;
RestClient.ApiPass = Properties.Settings.Default.ApiPass;
RestClient.ApiUser = Properties.Settings.Default.ApiUser;
RestClient.ApiURL = Properties.Settings.Default.ApiURL;
InitializeComponent();
}
......@@ -28,150 +33,32 @@ namespace RamaSignup
Finnish = 0,
English = 1,
}
Language currentLanguage = Language.English;
Image img;
Pen RetanglePen = new Pen(Color.Blue);
int RetangleHeight = 410;
int RetangleWidth = 280;
// Language currentLanguage = Language.English;
/*
void changed()
{
if (!pictureTaken && wc != null)
if (!pictureTaken )
{
if (currentLanguage == Language.English)
{
this.lblMessage.Text = "Take a picture first by pressing 'Use this picture' button";
}
else
{
this.lblMessage.Text = "Ota kuva ensin painamalla 'Käytä tätä kuvaa' nappia";
}
this.lblMessage.ForeColor = Color.Red;
this.btnSave.Enabled = false;
return;
}
string errorType = checkFields();
if (errorType != null)
{
if (currentLanguage == Language.English)
{
this.lblMessage.Text = errorType + " is missing or invalid. Fill the required fields with correct information.";
}
else
{
this.lblMessage.Text = errorType + " puuttuu tai on virheellinen. Täytä puuttuvat kentät oikeilla tiedoilla.";
}
this.lblMessage.ForeColor = Color.Red;
this.btnSave.Enabled = false;
return;
}
this.lblMessage.ForeColor = Color.Green;
if (currentLanguage == Language.English)
{
this.lblMessage.Text = "OK, verify information and click save";
}
else
{
this.lblMessage.Text = "OK, varmista tietojen oikeellisuus ja tallenna";
}
this.btnSave.Enabled = true;
}
}*/
string checkFields()
{
int tmp;
//checking validity
if (this.txtName.Text.Trim().Length < 5)
{
if (currentLanguage == Language.English)
return "Name";
else
return "Nimi";
}
else if (this.txtNick.Text.Trim().Length < 2)
{
if (currentLanguage == Language.English)
return "Nick";
else
return "Nick (nimimerkki)";
}
else if (this.txtAge.Text.Trim().Length < 1 || (!int.TryParse(this.txtAge.Text.Trim(), out tmp)))
{
if (currentLanguage == Language.English)
return "Age";
else
return "Ikä";
}
else if (this.cmbGender.SelectedIndex == 0)
{
if (currentLanguage == Language.English)
return "Gender";
else
return "Sukupuoli";
}
else if (this.txtPhone.Text.Length < 2)
{
if (currentLanguage == Language.English)
return "Phone number";
else
return "Puhelinnumero";
}
else if (this.txtEmail.Text.Trim().Length < 5)
{
if (currentLanguage == Language.English)
return "Email";
else
return "Sähköposti";
}
else if (this.txtAdress.Text.Trim().Length < 2)
{
if (currentLanguage == Language.English)
return "Address";
else
return "Lähiosoite";
}
else if (this.txtZip.Text.Trim().Length != 5 || (!int.TryParse(this.txtZip.Text.Trim(), out tmp)))
{
if (currentLanguage == Language.English)
return "Zip code";
else
return "Postinumero";
}
else if (this.txtCity.Text.Trim().Length < 2)
{
if (currentLanguage == Language.English)
return "City";
else
return "Paikkakunta";
}
/*
else if (this.cbTicketType.SelectedIndex == 0)
{
if (currentLanguage == Language.English)
return "Ticket type";
else
return "Lipun tyyppi";
}*/
else
{
return null;
}
}
void wc_RecievedFrame(object sender, WebCameraEventArgs e)
{
if (freeze)
{
this.pbIncoming.Refresh();
return;
}
img = (Image)e.Bitmap;
img.RotateFlip(RotateFlipType.RotateNoneFlipY);
this.pbIncoming.Image = BitmapFilter.Crop(img, RetangleWidth, RetangleHeight, ImageFilters.BitmapFilter.AnchorPosition.Free, 220, 220);
}
int groupId;
private void Form1_Load(object sender, EventArgs e)
{
......@@ -180,194 +67,35 @@ namespace RamaSignup
Application.ExitThread(); //program is required to close by autoupdate (probably updated)
return;
}
this.cmbGender.SelectedIndex = 0;
MessageBox.Show("Ohjelman saa sammutettua ikkunan tyhjästä kohdasta hiiren kakkosnapilla", "Tiedoksi", MessageBoxButtons.OK, MessageBoxIcon.Information);
//getTicketTypes();
/*
object orid = Objects.Pool.ExecScalar("SELECT id FROM ryhmat WHERE nimi = 'Vectorama' LIMIT 1");
if (orid == null || orid is DBNull)
{
MessageBox.Show("Oletusryhmää nimellä Vectorama ei löydy. Luo sellainen esim. seuraavalla queryllä:" + @"
insert into ryhmat (tunnus, deleted, pass, type, state, liput_alku, liput_loppu, toimitus, luotu, otettu, nimi, tietoja)
values ('99998', 0, '123451234512345123451234512345ab', 0, 3, null, null, 0, 1207561742, null, 'Vectorama', '');", "Oletusryhmä puuttuu", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
groupId = Convert.ToInt32(orid);
if (groupId < 1)
{
MessageBox.Show("Vectorama-ryhmällä on virheellinen ID-numero " + groupId, "Virheellinen ID oletusryhmällä", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
*/
this.wc = new WebCamera(this.panel1.Handle, 800, 600); // TODO viimeiseen kenttään conffista kameran numero
wc.RecievedFrame += new WebCamera.RecievedFrameEventHandler(wc_RecievedFrame);
if (!this.wc.StartWebCam())
{
MessageBox.Show("Error in connection with camera", "Error in connection with camera", MessageBoxButtons.OK, MessageBoxIcon.Error);
wc = null;
btnTakePic.Visible = false;
}
}
/*
void getTicketTypes()
{
SelectCreator sc = new SelectCreator("cardtypes");
sc.Fields.Add("id");
sc.Fields.Add("description");
sc.Where.AddTerm("active = true");
sc.Orderby.Add("id");
NpgsqlDataReader dr = Objects.Pool.ExecReader(sc.CreateSQL());
this.cbTicketType.Items.Clear();
this.cbTicketType.Items.Add(new TicketType(0, "-"));
while (dr.Read())
{
this.cbTicketType.Items.Add(new TicketType((int) dr["id"], (string) dr["description"]));
}
this.cbTicketType.SelectedIndex = 1;
dr.Close();
Objects.Pool.ReleaseConn(dr);
}*/
bool pictureTaken;
private void btnFinnish_Click(object sender, EventArgs e)
{
currentLanguage = Language.Finnish;
label1.Text = "Nimi:";
label2.Text = "Lempinimi / Nick:";
//label3.Text = "Lipun tyyppi:";
label4.Text = "Sähköpostiosoite:";
label5.Text = "Lähiosoite:";
label6.Text = "Postinumero:";
label7.Text = "Ikä:";
label8.Text = "Paikkakunta:";
label9.Text = "Puhelin:";
label10.Text = "Sukupuoli:";
label11.Text = "Sukunimi";
btnClear.Text = "Tyhjennä";
label12.Text = "Käyttäjänimi";
label13.Text = "Salasana";
label14.Text = "Salasana uudelleen";
this.cmbGender.Items.Clear();
this.cmbGender.Items.Add("En tiedä");
this.cmbGender.Items.Add("Mies");
this.cmbGender.Items.Add("Nainen");
this.cmbGender.SelectedIndex = 0;
if (freeze)
{
btnTakePic.Text = "Ota uusi kuva";
}
else
{
btnTakePic.Text = "Käytä tätä kuvaa";
}
btnSave.Text = "Tallenna";
this.cmbGender.Items[0] = "En tiedä";
}
private void btnEnglish_Click(object sender, EventArgs e)
{
currentLanguage = Language.English;
label1.Text = "First name:";
label2.Text = "Nickname:";
//label3.Text = "Ticket type:";
label4.Text = "E-Mail:";
label5.Text = "Address:";
label6.Text = "Zip:";
label7.Text = "Age:";
label8.Text = "City:";
label9.Text = "Phone:";
label10.Text = "Gender:";
label11.Text = "Last name:";
label12.Text = "Käyttäjänimi:";
label13.Text = "Passowrd:";
label14.Text = "Password again";
btnClear.Text = "Clear";
this.cmbGender.Items.Clear();
this.cmbGender.Items.Add("I don't know");
this.cmbGender.Items.Add("Male");
this.cmbGender.Items.Add("Female");
this.cmbGender.SelectedIndex = 0;
if (freeze)
{
btnTakePic.Text = "Take a new picture";
}
else
{
btnTakePic.Text = "Use current picture";
}
btnSave.Text = "Save";
this.cmbGender.Items[0] = "I don't know";
}
private void btnClear_Click(object sender, EventArgs e)
{
string msg, caption;
if (currentLanguage == Language.English)
{
msg = "Are you sure you want to clear the fields?";
caption = "Confirmation";
}
else
{
msg = "Haluatko varmasti nollata kentät?";
caption = "Varmistus";
}
DialogResult r = MessageBox.Show(msg, caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (r != DialogResult.OK)
return;
clear();
}
void clear()
{
this.cmbGender.SelectedIndex = 0;
txtAdress.Text = "";
txtAge.Text = "";
txtCity.Text = "";
txtEmail.Text = "";
txtName.Text = "";
txtNick.Text = "";
txtPhone.Text = "";
txtZip.Text = "";
btnSave.Enabled = false;
this.pbIncoming.Image = null;
//this.cbTicketType.SelectedIndex = 1;
pictureTaken = false;
changed();
}
bool checkSaveSafety()
{
//check nickname usage
if (false)
{
if (currentLanguage == Language.English)
{
MessageBox.Show("Nickname '"+this.txtNick.Text+"' already in use. Please choose another one.", "Nickname in use", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.lblMessage.Text = "Choose another nickname";
}
else
{
MessageBox.Show("Nimimerkki '"+this.txtNick.Text+"' on jo käytössä. Valitsetko toisen nimimerkin.", "Nick käytössä", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.lblMessage.Text = "Valitse toinen nick";
}
return false;
}
return true;
}
/*
private void btnSave_Click(object sender, EventArgs e)
{
if (!checkSaveSafety())
......@@ -384,37 +112,21 @@ namespace RamaSignup
//savePicture(pid);
if (currentLanguage == Language.English)
{
MessageBox.Show("Save successful.\r\nNow, to to the infodesk and tell them this number and they will tell you what to do.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Tallennus onnistui.\r\nMene infotiskille, ja kerro heille tämä numero, niin he opastavat sinut eteenpäin.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
clear();
MessageBox.Show("Tallennus onnistui.\r\nMene infotiskille, ja kerro heille tämä numero, niin he opastavat sinut eteenpäin.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Enabled = true;
this.Cursor = Cursors.Default;
}
}*/
void savePicture(int pid)
{
MemoryStream imageStream = new MemoryStream();
this.pbIncoming.Image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
imageStream.Position = 0;
byte[] imageContent = new Byte[imageStream.Length];
imageStream.Read(imageContent, 0, (int)imageStream.Length);
//Objects.Pool.ExecNonQuery("UPDATE kortit SET kuva = :bytesData WHERE id=" + pid, new Npgsql.NpgsqlParameter(":bytesData", imageContent));
return;
}
bool allowShutdown;
/*
private void txtName_TextChanged(object sender, EventArgs e)
{
changed();
}
}*/
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
......@@ -424,8 +136,6 @@ namespace RamaSignup
}
else
{
if (wc != null)
this.wc.CloseWebcam();
}
}
......@@ -455,46 +165,8 @@ namespace RamaSignup
}
}
public WebCamera wc;
bool freeze;
private void btnTakePic_Click(object sender, EventArgs e)
{
this.btnTakePic.Enabled = false;
this.Cursor = Cursors.WaitCursor;
this.btnTakePic.Refresh();
if (freeze)
{
freeze = false;
this.wc.StartWebCam();
if (currentLanguage == Language.English)
{
this.btnTakePic.Text = "Use current picture";
}
else
{
this.btnTakePic.Text = "Käytä tätä kuvaa";
}
pictureTaken = false;
changed();
}
else
{
freeze = true;
this.wc.CloseWebcam();
if (currentLanguage == Language.English)
{
this.btnTakePic.Text = "Take a new picture";
}
else
{
this.btnTakePic.Text = "Ota uusi kuva";
}
pictureTaken = true;
changed();
}
this.Cursor = Cursors.Default;
this.btnTakePic.Enabled = true;
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
......@@ -505,66 +177,35 @@ namespace RamaSignup
return;
}*/
}
private void txtNick_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtAge_TextChanged(object sender, EventArgs e)
{
changed();
}
private void cmbGender_SelectedIndexChanged(object sender, EventArgs e)
{
changed();
}
private void txtPhone_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtEmail_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtAdress_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtZip_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtCity_TextChanged(object sender, EventArgs e)
private void button1_Click(object sender, EventArgs e)
{
changed();
allowShutdown = true;
Application.Exit();
}
private void cbTicketType_SelectedIndexChanged(object sender, EventArgs e)
private void userLoginControl1_LoginOk(object sender, EventArgs e)
{
changed();
userLoginControl1.Visible = false;
userDetailsEditor1.LoadUser(userLoginControl1.CurrentUser);
userLoginControl1.Clear();
userDetailsEditor1.Visible = true;
//userLoginControl1.CurrentUser;
}
private void lbMessage_Click(object sender, EventArgs e)
private void userDetailsEditor1_Load(object sender, EventArgs e)
{
}
private void label13_Click(object sender, EventArgs e)
private void userDetailsEditor1_CloseView(object sender, EventArgs e)
{
userDetailsEditor1.Visible = false;
userLoginControl1.Visible = true;
}
private void button1_Click(object sender, EventArgs e)
{
allowShutdown = true;
Application.Exit();
}
}
}
......@@ -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;
}
}
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 WebCam;
using ImageFilters;
using System.IO;
using Touchless.Vision.Camera;
using MoyaAdminLib;
using System.Net;
using System.Collections.Specialized;
using System.Drawing.Imaging;
namespace RamaSignup
{
public partial class TakePictureControl : UserControl
{
//Image img;
Pen RetanglePen = new Pen(Color.Blue);
int RetangleHeight = 410;
int RetangleWidth = 280;
//bool freeze;
// bool pictureTaken = false;
bool cameraOpen = false;
private CameraFrameSource _frameSource;
private static Bitmap latestFrame;
public event EventHandler Changed;
public TakePictureControl()
{
InitializeComponent();
//800,600
//this.webcam = new WebCamera(this.Handle, 320, 240); // TODO viimeiseen kenttään conffista kameran numero
//webcam.RecievedFrame += new WebCamera.RecievedFrameEventHandler(wc_RecievedFrame);
RetangleHeight = pbIncoming.Size.Height;
RetangleWidth = pbIncoming.Size.Width;
}
public void loadUserImage(User user)
{
if (user.UserId == 0)
return;
string api = RestClient.GetRequestURL(Properties.Settings.Default.ApiURL, "v2/user/" + user.UserId + "/image");
WebRequest request = WebRequest.Create(api);
try
{
using (WebResponse response = request.GetResponse())
{
using (Stream stream = response.GetResponseStream())
{
pbIncoming.Image = Bitmap.FromStream(stream);
}
}
}
catch (Exception e)
{
//toolStripStatusLabel1.Text = e.Message;
return;
}
Console.WriteLine(user.EventUserId);
}
private void getJpeg(Stream datastream)
{
EncoderParameter qualityParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 75L); //quality 75
ImageCodecInfo jpegCodec = this.getEncoderInfo("image/jpeg");
if (jpegCodec == null)
return;
EncoderParameters encoderParams = new EncoderParameters(1);
encoderParams.Param[0] = qualityParam;
latestFrame.Save(datastream, jpegCodec, encoderParams);
}
private ImageCodecInfo getEncoderInfo(string mimeType)
{
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
for (int i = 0; i < codecs.Length; i++)
if (codecs[i].MimeType == mimeType)
return codecs[i];
return null;
}
private string StreamToString(Stream responseStream)
{
StreamReader reader = new StreamReader(responseStream);
string responseString = reader.ReadToEnd();
responseStream.Close();
reader.Close();
return responseString;
}
public void SaveUserImage(User user)
{
string url = RestClient.GetRequestURL(Properties.Settings.Default.ApiURL, "v2/user/" + user.UserId + "/image");
NameValueCollection postParameters = new NameValueCollection();
//postParameters.Add("password", Util.CreatePasswordHash(this.password));
//postParameters.Add("crc", crc);
//postParameters.Add("size", size);
//postParameters.Add("filename", "image.jpg");
//postParameters.Add("name", "image.jpg");
string contentType = "image/jpeg";
//string paramName = file;
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
wr.ContentType = "multipart/form-data; boundary=" + boundary;
wr.Method = "PUT";
wr.KeepAlive = true;
wr.Credentials = System.Net.CredentialCache.DefaultCredentials;
Stream rs = wr.GetRequestStream();
string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";
foreach (string key in postParameters.Keys)
{
rs.Write(boundarybytes, 0, boundarybytes.Length);
string formitem = string.Format(formdataTemplate, key, postParameters[key]);
byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem);
rs.Write(formitembytes, 0, formitembytes.Length);
}
rs.Write(boundarybytes, 0, boundarybytes.Length);
string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n";
//string header = string.Format(headerTemplate, paramName, "recording", contentType);
string header = string.Format(headerTemplate, "image", "image.jpg", contentType);
byte[] headerbytes = System.Text.Encoding.UTF8.GetBytes(header);
rs.Write(headerbytes, 0, headerbytes.Length);
getJpeg(rs);
byte[] trailer = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n");
rs.Write(trailer, 0, trailer.Length);
rs.Close();
HttpWebResponse response = null;
string responseValue = "";
try
{
response = (HttpWebResponse)wr.GetResponse();
// Read data if there is no exception tet
responseValue = StreamToString(response.GetResponseStream());
// deserialize it if still no exception
Console.WriteLine(responseValue);
}
catch (Exception ex)
{
if (ex is WebException)
{
//Debug.WriteLine("WebException occurred. Ex: " + ex.Message, Debug.DebugChain.ExeptionMessage);
Stream responseStream = ((WebException)ex).Response.GetResponseStream();
if (responseStream != null)
{
responseValue = StreamToString(responseStream);
// Debug.WriteLine("Response was " + responseValue, Debug.DebugChain.Notify);
// return serializer.Deserialize<RestError>(responseValue);
return;
}
//return new RestError("RestServerError");
return;
}
else
{
//Debug.WriteLine("Exception at file upload" + ex.Message, Debug.DebugChain.ExeptionMessage);
//return new RestError("RestClientError");
return;
}
}
finally
{
wr = null;
}
}
private void startCapturing()
{
try
{
Camera c = CameraService.AvailableCameras.First();
setFrameSource(new CameraFrameSource(c));
//_frameSource.Camera.CaptureWidth = 1024;
//_frameSource.Camera.CaptureHeight = 768;
_frameSource.Camera.CaptureWidth = 640;
_frameSource.Camera.CaptureHeight = 480;
_frameSource.Camera.Fps = 50;
_frameSource.NewFrame += OnImageCaptured;
pbIncoming.Paint += new PaintEventHandler(drawLatestImage);
_frameSource.StartFrameCapture();
}
catch (Exception ex)
{
pbIncoming.Text = "Select A Camera";
MessageBox.Show(ex.Message);
}
}
private void drawLatestImage(object sender, PaintEventArgs e)
{
if (latestFrame != null)
{
// Draw the latest image from the active camera
e.Graphics.DrawImage(latestFrame, 0, 0, latestFrame.Width, latestFrame.Height);
}
}
private void thrashOldCamera()
{
// Trash the old camera
if (_frameSource != null)
{
_frameSource.NewFrame -= OnImageCaptured;
_frameSource.Camera.Dispose();
setFrameSource(null);
pbIncoming.Paint -= new PaintEventHandler(drawLatestImage);
}
}
public void OnImageCaptured(Touchless.Vision.Contracts.IFrameSource frameSource, Touchless.Vision.Contracts.Frame frame, double fps)
{
latestFrame = BitmapFilter.Crop(frame.Image, RetangleWidth, RetangleHeight, ImageFilters.BitmapFilter.AnchorPosition.Free, 220, 220);
//_latestFrame.RotateFlip(RotateFlipType.RotateNoneFlipY);
this.pbIncoming.Invalidate();
/*
if (freeze)
{
this.pbIncoming.Refresh();
return;
}
img = frame.Image;
//img.RotateFlip(RotateFlipType.RotateNoneFlipY);
this.pbIncoming.Image = BitmapFilter.Crop(img, RetangleWidth, RetangleHeight, ImageFilters.BitmapFilter.AnchorPosition.Free, 220, 220);*/
}
private void setFrameSource(CameraFrameSource cameraFrameSource)
{
if (_frameSource == cameraFrameSource)
return;
_frameSource = cameraFrameSource;
}
private void clear()
{
this.pbIncoming.Image = null;
//pictureTaken = false;
}
void savePicture(int pid)
{
MemoryStream imageStream = new MemoryStream();
this.pbIncoming.Image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
imageStream.Position = 0;
byte[] imageContent = new Byte[imageStream.Length];
imageStream.Read(imageContent, 0, (int)imageStream.Length);
//Objects.Pool.ExecNonQuery("UPDATE kortit SET kuva = :bytesData WHERE id=" + pid, new Npgsql.NpgsqlParameter(":bytesData", imageContent));
return;
}
/*
private void btnTakePic_Click(object sender, EventArgs e)
{
this.btnTakePic.Enabled = false;
this.Cursor = Cursors.WaitCursor;
this.btnTakePic.Refresh();
if (freeze)
{
freeze = false;
//this.webcam.StartWebCam();
this.btnTakePic.Text = "Käytä tätä kuvaa";
pictureTaken = false;
}
else
{
freeze = true;
//this.webcam.CloseWebcam();
this.btnTakePic.Text = "Ota uusi kuva";
pictureTaken = true;
}
this.Cursor = Cursors.Default;
this.btnTakePic.Enabled = true;
}
* */
private void TakePictureControl_VisibleChanged(object sender, EventArgs e)
{
if (!this.Visible)
{
//if (webcam != null)
// this.webcam.CloseWebcam();
}
}
public void TakePicture()
{
/*
if (_frameSource != null && _frameSource.Camera == CameraService.AvailableCameras.First())
return;
*/
if (!cameraOpen)
{
btnTakePic.Enabled = false;
cameraOpen = true;
btnTakePic.Text = "Käytä tätä kuvaa";
thrashOldCamera();
startCapturing();
btnTakePic.Enabled = true;
}
else
{
btnTakePic.Enabled = false;
cameraOpen = false;
btnTakePic.Text = "Ota uusi kuva";
thrashOldCamera();
pbIncoming.Image = latestFrame;
btnTakePic.Enabled = true;
if (Changed != null)
Changed(null, null);
}
}
private void btnTakePic_Click_1(object sender, EventArgs e)
{
TakePicture();
}
}
}
<?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 UserDetailsEditor
{
/// <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.label11 = new System.Windows.Forms.Label();
this.txtLastName = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.cbGender = new System.Windows.Forms.ComboBox();
this.txtPhone = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.txtCity = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtZip = new System.Windows.Forms.TextBox();
this.txtAdress = new System.Windows.Forms.TextBox();
this.txtEmail = new System.Windows.Forms.TextBox();
this.txtNick = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtFirstName = new System.Windows.Forms.TextBox();
this.lblMessage = new System.Windows.Forms.Label();
this.dateTimePickerAge = new System.Windows.Forms.DateTimePicker();
this.btnSaveData = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.takePictureControl1 = new RamaSignup.TakePictureControl();
this.SuspendLayout();
//
// label11
//
this.label11.AutoSize = true;
this.label11.BackColor = System.Drawing.Color.Transparent;
this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label11.Location = new System.Drawing.Point(271, 56);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(70, 16);
this.label11.TabIndex = 116;
this.label11.Text = "Sukunimi";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtLastName
//
this.txtLastName.BackColor = System.Drawing.SystemColors.Window;
this.txtLastName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtLastName.Location = new System.Drawing.Point(274, 75);
this.txtLastName.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtLastName.Name = "txtLastName";
this.txtLastName.ReadOnly = true;
this.txtLastName.Size = new System.Drawing.Size(135, 26);
this.txtLastName.TabIndex = 115;
//
// label10
//
this.label10.AutoSize = true;
this.label10.BackColor = System.Drawing.Color.Transparent;
this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label10.Location = new System.Drawing.Point(137, 111);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(76, 16);
this.label10.TabIndex = 114;
this.label10.Text = "Sukupuoli";
//
// cbGender
//
this.cbGender.BackColor = System.Drawing.SystemColors.Window;
this.cbGender.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbGender.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cbGender.FormattingEnabled = true;
this.cbGender.Location = new System.Drawing.Point(140, 129);
this.cbGender.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.cbGender.Name = "cbGender";
this.cbGender.Size = new System.Drawing.Size(125, 28);
this.cbGender.TabIndex = 100;
//
// txtPhone
//
this.txtPhone.BackColor = System.Drawing.SystemColors.Window;
this.txtPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtPhone.Location = new System.Drawing.Point(271, 130);
this.txtPhone.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtPhone.Name = "txtPhone";
this.txtPhone.ReadOnly = true;
this.txtPhone.Size = new System.Drawing.Size(138, 26);
this.txtPhone.TabIndex = 101;
//
// label9
//
this.label9.AutoSize = true;
this.label9.BackColor = System.Drawing.Color.Transparent;
this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label9.Location = new System.Drawing.Point(268, 111);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(110, 16);
this.label9.TabIndex = 113;
this.label9.Text = "Puhelinnumero";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtCity
//
this.txtCity.BackColor = System.Drawing.SystemColors.Window;
this.txtCity.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtCity.Location = new System.Drawing.Point(140, 242);
this.txtCity.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtCity.Name = "txtCity";
this.txtCity.ReadOnly = true;
this.txtCity.Size = new System.Drawing.Size(125, 26);
this.txtCity.TabIndex = 105;
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label8.Location = new System.Drawing.Point(137, 223);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(71, 16);
this.label8.TabIndex = 112;
this.label8.Text = "Kaupunki";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label7
//
this.label7.AutoSize = true;
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(3, 111);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(97, 16);
this.label7.TabIndex = 111;
this.label7.Text = "Syntymäaika";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label6.Location = new System.Drawing.Point(3, 223);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(94, 16);
this.label6.TabIndex = 110;
this.label6.Text = "Postinumero";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(3, 168);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(81, 16);
this.label5.TabIndex = 109;
this.label5.Text = "Katuosoite";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// 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(3, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(52, 16);
this.label4.TabIndex = 108;
this.label4.Text = "E-Mail";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtZip
//
this.txtZip.BackColor = System.Drawing.SystemColors.Window;
this.txtZip.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtZip.Location = new System.Drawing.Point(6, 242);
this.txtZip.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtZip.Name = "txtZip";
this.txtZip.ReadOnly = true;
this.txtZip.Size = new System.Drawing.Size(128, 26);
this.txtZip.TabIndex = 104;
//
// txtAdress
//
this.txtAdress.BackColor = System.Drawing.SystemColors.Window;
this.txtAdress.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtAdress.Location = new System.Drawing.Point(6, 187);
this.txtAdress.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtAdress.Name = "txtAdress";
this.txtAdress.ReadOnly = true;
this.txtAdress.Size = new System.Drawing.Size(403, 26);
this.txtAdress.TabIndex = 103;
//
// 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(6, 19);
this.txtEmail.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtEmail.Name = "txtEmail";
this.txtEmail.ReadOnly = true;
this.txtEmail.Size = new System.Drawing.Size(403, 26);
this.txtEmail.TabIndex = 102;
//
// txtNick
//
this.txtNick.BackColor = System.Drawing.SystemColors.Window;
this.txtNick.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtNick.Location = new System.Drawing.Point(6, 75);
this.txtNick.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtNick.MaxLength = 12;
this.txtNick.Name = "txtNick";
this.txtNick.ReadOnly = true;
this.txtNick.Size = new System.Drawing.Size(128, 26);
this.txtNick.TabIndex = 98;
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(3, 56);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(85, 16);
this.label2.TabIndex = 107;
this.label2.Text = "Nimimerkki";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(137, 56);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(58, 16);
this.label1.TabIndex = 106;
this.label1.Text = "Etunimi";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtFirstName
//
this.txtFirstName.BackColor = System.Drawing.SystemColors.Window;
this.txtFirstName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtFirstName.Location = new System.Drawing.Point(140, 75);
this.txtFirstName.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtFirstName.Name = "txtFirstName";
this.txtFirstName.ReadOnly = true;
this.txtFirstName.Size = new System.Drawing.Size(125, 26);
this.txtFirstName.TabIndex = 97;
//
// lblMessage
//
this.lblMessage.BackColor = System.Drawing.Color.Transparent;
this.lblMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMessage.Location = new System.Drawing.Point(3, 311);
this.lblMessage.Name = "lblMessage";
this.lblMessage.Size = new System.Drawing.Size(555, 73);
this.lblMessage.TabIndex = 117;
this.lblMessage.Text = "label3";
this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// dateTimePickerAge
//
this.dateTimePickerAge.CustomFormat = "dd.MM.yyyy";
this.dateTimePickerAge.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePickerAge.Location = new System.Drawing.Point(9, 131);
this.dateTimePickerAge.Name = "dateTimePickerAge";
this.dateTimePickerAge.Size = new System.Drawing.Size(125, 20);
this.dateTimePickerAge.TabIndex = 119;
//
// btnSaveData
//
this.btnSaveData.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold);
this.btnSaveData.Location = new System.Drawing.Point(287, 441);
this.btnSaveData.Name = "btnSaveData";
this.btnSaveData.Size = new System.Drawing.Size(271, 30);
this.btnSaveData.TabIndex = 120;
this.btnSaveData.Text = "Tallenna kuva ja tiedot";
this.btnSaveData.UseVisualStyleBackColor = true;
this.btnSaveData.Click += new System.EventHandler(this.btnSaveData_Click);
//
// btnCancel
//
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold);
this.btnCancel.Location = new System.Drawing.Point(9, 441);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(272, 30);
this.btnCancel.TabIndex = 121;
this.btnCancel.Text = "Keskeytä";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// takePictureControl1
//
this.takePictureControl1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.takePictureControl1.Location = new System.Drawing.Point(564, 19);
this.takePictureControl1.Name = "takePictureControl1";
this.takePictureControl1.Size = new System.Drawing.Size(308, 463);
this.takePictureControl1.TabIndex = 118;
//
// UserDetailsEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnSaveData);
this.Controls.Add(this.dateTimePickerAge);
this.Controls.Add(this.takePictureControl1);
this.Controls.Add(this.lblMessage);
this.Controls.Add(this.label11);
this.Controls.Add(this.txtLastName);
this.Controls.Add(this.label10);
this.Controls.Add(this.cbGender);
this.Controls.Add(this.txtPhone);
this.Controls.Add(this.label9);
this.Controls.Add(this.txtCity);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.txtZip);
this.Controls.Add(this.txtAdress);
this.Controls.Add(this.txtEmail);
this.Controls.Add(this.txtNick);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtFirstName);
this.Name = "UserDetailsEditor";
this.Size = new System.Drawing.Size(875, 524);
this.Load += new System.EventHandler(this.UserDetailsEditor_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txtLastName;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.ComboBox cbGender;
private System.Windows.Forms.TextBox txtPhone;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtCity;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtZip;
private System.Windows.Forms.TextBox txtAdress;
private System.Windows.Forms.TextBox txtEmail;
private System.Windows.Forms.TextBox txtNick;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtFirstName;
private System.Windows.Forms.Label lblMessage;
private TakePictureControl takePictureControl1;
private System.Windows.Forms.DateTimePicker dateTimePickerAge;
private System.Windows.Forms.Button btnSaveData;
private System.Windows.Forms.Button btnCancel;
}
}
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.cpp
// Project: WebcamLib
// Author(s): John Conwell
// Gary Caldwell
//
// Defines the webcam DirectShow wrapper used by TouchlessLib
//*****************************************************************************************
#include <dshow.h>
#include <strsafe.h>
#define __IDxtCompositor_INTERFACE_DEFINED__
#define __IDxtAlphaSetter_INTERFACE_DEFINED__
#define __IDxtJpeg_INTERFACE_DEFINED__
#define __IDxtKey_INTERFACE_DEFINED__
#pragma include_alias( "dxtrans.h", "qedit.h" )
#include "qedit.h"
#include "WebCamLib.h"
using namespace System;
using namespace System::Reflection;
using namespace WebCamLib;
// Private variables
#define MAX_CAMERAS 10
// Structure to hold camera information
struct CameraInfoStruct
{
BSTR bstrName;
IMoniker* pMoniker;
};
// Private global variables
IGraphBuilder* g_pGraphBuilder = NULL;
IMediaControl* g_pMediaControl = NULL;
ICaptureGraphBuilder2* g_pCaptureGraphBuilder = NULL;
IBaseFilter* g_pIBaseFilterCam = NULL;
IBaseFilter* g_pIBaseFilterSampleGrabber = NULL;
IBaseFilter* g_pIBaseFilterNullRenderer = NULL;
CameraInfoStruct g_aCameraInfo[MAX_CAMERAS] = {0};
// http://social.msdn.microsoft.com/Forums/sk/windowsdirectshowdevelopment/thread/052d6a15-f092-4913-b52d-d28f9a51e3b6
void MyFreeMediaType(AM_MEDIA_TYPE& mt) {
if (mt.cbFormat != 0) {
CoTaskMemFree((PVOID)mt.pbFormat);
mt.cbFormat = 0;
mt.pbFormat = NULL;
}
if (mt.pUnk != NULL) {
// Unecessary because pUnk should not be used, but safest.
mt.pUnk->Release();
mt.pUnk = NULL;
}
}
void MyDeleteMediaType(AM_MEDIA_TYPE *pmt) {
if (pmt != NULL) {
MyFreeMediaType(*pmt); // See FreeMediaType for the implementation.
CoTaskMemFree(pmt);
}
}
/// <summary>
/// Initializes information about all web cams connected to machine
/// </summary>
CameraMethods::CameraMethods()
{
// Set to not disposed
this->disposed = false;
// Get and cache camera info
RefreshCameraList();
}
/// <summary>
/// IDispose
/// </summary>
CameraMethods::~CameraMethods()
{
Cleanup();
disposed = true;
}
/// <summary>
/// Finalizer
/// </summary>
CameraMethods::!CameraMethods()
{
if (!disposed)
{
Cleanup();
}
}
/// <summary>
/// Initialize information about webcams installed on machine
/// </summary>
void CameraMethods::RefreshCameraList()
{
IEnumMoniker* pclassEnum = NULL;
ICreateDevEnum* pdevEnum = NULL;
int count = 0;
CleanupCameraInfo();
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum,
NULL,
CLSCTX_INPROC,
IID_ICreateDevEnum,
(LPVOID*)&pdevEnum);
if (SUCCEEDED(hr))
{
hr = pdevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pclassEnum, 0);
}
if (pdevEnum != NULL)
{
pdevEnum->Release();
pdevEnum = NULL;
}
if (pclassEnum != NULL)
{
IMoniker* apIMoniker[1];
ULONG ulCount = 0;
while (SUCCEEDED(hr) && (count) < MAX_CAMERAS && pclassEnum->Next(1, apIMoniker, &ulCount) == S_OK)
{
g_aCameraInfo[count].pMoniker = apIMoniker[0];
g_aCameraInfo[count].pMoniker->AddRef();
IPropertyBag *pPropBag;
hr = apIMoniker[0]->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropBag);
if (SUCCEEDED(hr))
{
// Retrieve the filter's friendly name
VARIANT varName;
VariantInit(&varName);
hr = pPropBag->Read(L"FriendlyName", &varName, 0);
if (SUCCEEDED(hr) && varName.vt == VT_BSTR)
{
g_aCameraInfo[count].bstrName = SysAllocString(varName.bstrVal);
}
VariantClear(&varName);
pPropBag->Release();
}
count++;
}
pclassEnum->Release();
}
this->Count = count;
if (!SUCCEEDED(hr))
throw gcnew COMException("Error Refreshing Camera List", hr);
}
/// <summary>
/// Retrieve information about a specific camera
/// Use the count property to determine valid indicies to pass in
/// </summary>
CameraInfo^ CameraMethods::GetCameraInfo(int camIndex)
{
if (camIndex >= Count)
throw gcnew ArgumentException("Camera index is out of bounds: " + Count.ToString());
if (g_aCameraInfo[camIndex].pMoniker == NULL)
throw gcnew ArgumentException("There is no camera at index: " + camIndex.ToString());
CameraInfo^ camInfo = gcnew CameraInfo();
camInfo->index = camIndex;
camInfo->name = Marshal::PtrToStringBSTR((IntPtr)g_aCameraInfo[camIndex].bstrName);
return camInfo;
}
/// <summary>
/// Start the camera associated with the input handle
/// </summary>
void CameraMethods::StartCamera(int camIndex, interior_ptr<int> width, interior_ptr<int> height)
{
if (camIndex >= Count)
throw gcnew ArgumentException("Camera index is out of bounds: " + Count.ToString());
if (g_aCameraInfo[camIndex].pMoniker == NULL)
throw gcnew ArgumentException("There is no camera at index: " + camIndex.ToString());
if (g_pGraphBuilder != NULL)
throw gcnew ArgumentException("Graph Builder was null");
// Setup up function callback -- through evil reflection on private members
Type^ baseType = this->GetType();
FieldInfo^ field = baseType->GetField("<backing_store>OnImageCapture", BindingFlags::NonPublic | BindingFlags::Instance | BindingFlags::IgnoreCase);
if (field != nullptr)
{
Object^ obj = field->GetValue(this);
if (obj != nullptr)
{
CameraMethods::CaptureCallbackDelegate^ del = (CameraMethods::CaptureCallbackDelegate^)field->GetValue(this);
if (del != nullptr)
{
ppCaptureCallback = GCHandle::Alloc(del);
g_pfnCaptureCallback =
static_cast<PFN_CaptureCallback>(Marshal::GetFunctionPointerForDelegate(del).ToPointer());
}
}
}
IMoniker *pMoniker = g_aCameraInfo[camIndex].pMoniker;
pMoniker->AddRef();
HRESULT hr = S_OK;
// Build all the necessary interfaces to start the capture
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_FilterGraph,
NULL,
CLSCTX_INPROC,
IID_IGraphBuilder,
(LPVOID*)&g_pGraphBuilder);
}
if (SUCCEEDED(hr))
{
hr = g_pGraphBuilder->QueryInterface(IID_IMediaControl, (LPVOID*)&g_pMediaControl);
}
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_CaptureGraphBuilder2,
NULL,
CLSCTX_INPROC,
IID_ICaptureGraphBuilder2,
(LPVOID*)&g_pCaptureGraphBuilder);
}
// Setup the filter graph
if (SUCCEEDED(hr))
{
hr = g_pCaptureGraphBuilder->SetFiltergraph(g_pGraphBuilder);
}
// Build the camera from the moniker
if (SUCCEEDED(hr))
{
hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter, (LPVOID*)&g_pIBaseFilterCam);
}
// Add the camera to the filter graph
if (SUCCEEDED(hr))
{
hr = g_pGraphBuilder->AddFilter(g_pIBaseFilterCam, L"WebCam");
}
// Set the resolution
if (SUCCEEDED(hr)) {
hr = SetCaptureFormat(g_pIBaseFilterCam, *width, *height);
}
// Create a SampleGrabber
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pIBaseFilterSampleGrabber);
}
// Configure the Sample Grabber
if (SUCCEEDED(hr))
{
hr = ConfigureSampleGrabber(g_pIBaseFilterSampleGrabber);
}
// Add Sample Grabber to the filter graph
if (SUCCEEDED(hr))
{
hr = g_pGraphBuilder->AddFilter(g_pIBaseFilterSampleGrabber, L"SampleGrabber");
}
// Create the NullRender
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pIBaseFilterNullRenderer);
}
// Add the Null Render to the filter graph
if (SUCCEEDED(hr))
{
hr = g_pGraphBuilder->AddFilter(g_pIBaseFilterNullRenderer, L"NullRenderer");
}
// Configure the render stream
if (SUCCEEDED(hr))
{
hr = g_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, g_pIBaseFilterCam, g_pIBaseFilterSampleGrabber, g_pIBaseFilterNullRenderer);
}
// Grab the capture width and height
if (SUCCEEDED(hr))
{
ISampleGrabber* pGrabber = NULL;
hr = g_pIBaseFilterSampleGrabber->QueryInterface(IID_ISampleGrabber, (LPVOID*)&pGrabber);
if (SUCCEEDED(hr))
{
AM_MEDIA_TYPE mt;
hr = pGrabber->GetConnectedMediaType(&mt);
if (SUCCEEDED(hr))
{
VIDEOINFOHEADER *pVih;
if ((mt.formattype == FORMAT_VideoInfo) &&
(mt.cbFormat >= sizeof(VIDEOINFOHEADER)) &&
(mt.pbFormat != NULL) )
{
pVih = (VIDEOINFOHEADER*)mt.pbFormat;
*width = pVih->bmiHeader.biWidth;
*height = pVih->bmiHeader.biHeight;
}
else
{
hr = E_FAIL; // Wrong format
}
// FreeMediaType(mt); (from MSDN)
if (mt.cbFormat != 0)
{
CoTaskMemFree((PVOID)mt.pbFormat);
mt.cbFormat = 0;
mt.pbFormat = NULL;
}
if (mt.pUnk != NULL)
{
// Unecessary because pUnk should not be used, but safest.
mt.pUnk->Release();
mt.pUnk = NULL;
}
}
}
if (pGrabber != NULL)
{
pGrabber->Release();
pGrabber = NULL;
}
}
// Start the capture
if (SUCCEEDED(hr))
{
hr = g_pMediaControl->Run();
}
// If init fails then ensure that you cleanup
if (FAILED(hr))
{
StopCamera();
}
else
{
hr = S_OK; // Make sure we return S_OK for success
}
// Cleanup
if (pMoniker != NULL)
{
pMoniker->Release();
pMoniker = NULL;
}
if (SUCCEEDED(hr))
this->activeCameraIndex = camIndex;
else
throw gcnew COMException("Error Starting Camera", hr);
}
void CameraMethods::SetProperty(long lProperty, long lValue, bool bAuto)
{
if (g_pIBaseFilterCam == NULL) throw gcnew ArgumentException("No Camera started");
HRESULT hr = S_OK;
// Query the capture filter for the IAMVideoProcAmp interface.
IAMVideoProcAmp *pProcAmp = 0;
hr = g_pIBaseFilterCam->QueryInterface(IID_IAMVideoProcAmp, (void**)&pProcAmp);
// Get the range and default value.
long Min, Max, Step, Default, Flags;
if (SUCCEEDED(hr)) {
hr = pProcAmp->GetRange(lProperty, &Min, &Max, &Step, &Default, &Flags);
}
if (SUCCEEDED(hr)) {
lValue = Min + (Max - Min) * lValue / 100;
hr = pProcAmp->Set(lProperty, lValue, bAuto ? VideoProcAmp_Flags_Auto : VideoProcAmp_Flags_Manual);
}
if (!SUCCEEDED(hr)) throw gcnew COMException("Error Set Property", hr);
}
/// <summary>
/// Closes any open webcam and releases all unmanaged resources
/// </summary>
void CameraMethods::Cleanup()
{
StopCamera();
CleanupCameraInfo();
// Clean up pinned pointer to callback delegate
if (ppCaptureCallback.IsAllocated)
{
ppCaptureCallback.Free();
}
}
/// <summary>
/// Stops the current open webcam
/// </summary>
void CameraMethods::StopCamera()
{
if (g_pMediaControl != NULL)
{
g_pMediaControl->Stop();
g_pMediaControl->Release();
g_pMediaControl = NULL;
}
g_pfnCaptureCallback = NULL;
if (g_pIBaseFilterNullRenderer != NULL)
{
g_pIBaseFilterNullRenderer->Release();
g_pIBaseFilterNullRenderer = NULL;
}
if (g_pIBaseFilterSampleGrabber != NULL)
{
g_pIBaseFilterSampleGrabber->Release();
g_pIBaseFilterSampleGrabber = NULL;
}
if (g_pIBaseFilterCam != NULL)
{
g_pIBaseFilterCam->Release();
g_pIBaseFilterCam = NULL;
}
if (g_pGraphBuilder != NULL)
{
g_pGraphBuilder->Release();
g_pGraphBuilder = NULL;
}
if (g_pCaptureGraphBuilder != NULL)
{
g_pCaptureGraphBuilder->Release();
g_pCaptureGraphBuilder = NULL;
}
this->activeCameraIndex = -1;
}
/// <summary>
/// Show the properties dialog for the specified webcam
/// </summary>
void CameraMethods::DisplayCameraPropertiesDialog(int camIndex)
{
if (camIndex >= Count)
throw gcnew ArgumentException("Camera index is out of bounds: " + Count.ToString());
if (g_aCameraInfo[camIndex].pMoniker == NULL)
throw gcnew ArgumentException("There is no camera at index: " + camIndex.ToString());
HRESULT hr = S_OK;
IBaseFilter *pFilter = NULL;
ISpecifyPropertyPages *pProp = NULL;
IMoniker *pMoniker = g_aCameraInfo[camIndex].pMoniker;
pMoniker->AddRef();
// Create a filter graph for the moniker
if (SUCCEEDED(hr))
{
hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter, (LPVOID*)&pFilter);
}
// See if it implements a property page
if (SUCCEEDED(hr))
{
hr = pFilter->QueryInterface(IID_ISpecifyPropertyPages, (LPVOID*)&pProp);
}
// Show the property page
if (SUCCEEDED(hr))
{
FILTER_INFO filterinfo;
hr = pFilter->QueryFilterInfo(&filterinfo);
IUnknown *pFilterUnk = NULL;
if (SUCCEEDED(hr))
{
hr = pFilter->QueryInterface(IID_IUnknown, (LPVOID*)&pFilterUnk);
}
if (SUCCEEDED(hr))
{
CAUUID caGUID;
pProp->GetPages(&caGUID);
OleCreatePropertyFrame(
NULL, // Parent window
0, 0, // Reserved
filterinfo.achName, // Caption for the dialog box
1, // Number of objects (just the filter)
&pFilterUnk, // Array of object pointers.
caGUID.cElems, // Number of property pages
caGUID.pElems, // Array of property page CLSIDs
0, // Locale identifier
0, NULL // Reserved
);
}
if (pFilterUnk != NULL)
{
pFilterUnk->Release();
pFilterUnk = NULL;
}
}
if (pProp != NULL)
{
pProp->Release();
pProp = NULL;
}
if (pMoniker != NULL)
{
pMoniker->Release();
pMoniker = NULL;
}
if (pFilter != NULL)
{
pFilter->Release();
pFilter = NULL;
}
if (!SUCCEEDED(hr))
throw gcnew COMException("Error displaying camera properties dialog", hr);
}
/// <summary>
/// Releases all unmanaged resources
/// </summary>
void CameraMethods::CleanupCameraInfo()
{
for (int n = 0; n < MAX_CAMERAS; n++)
{
SysFreeString(g_aCameraInfo[n].bstrName);
g_aCameraInfo[n].bstrName = NULL;
if (g_aCameraInfo[n].pMoniker != NULL)
{
g_aCameraInfo[n].pMoniker->Release();
g_aCameraInfo[n].pMoniker = NULL;
}
}
}
/// <summary>
/// Setup the callback functionality for DirectShow
/// </summary>
HRESULT CameraMethods::ConfigureSampleGrabber(IBaseFilter *pIBaseFilter)
{
HRESULT hr = S_OK;
ISampleGrabber *pGrabber = NULL;
hr = pIBaseFilter->QueryInterface(IID_ISampleGrabber, (void**)&pGrabber);
if (SUCCEEDED(hr))
{
AM_MEDIA_TYPE mt;
ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
mt.majortype = MEDIATYPE_Video;
mt.subtype = MEDIASUBTYPE_RGB24;
mt.formattype = FORMAT_VideoInfo;
hr = pGrabber->SetMediaType(&mt);
}
if (SUCCEEDED(hr))
{
hr = pGrabber->SetCallback(new SampleGrabberCB(), 1);
}
if (pGrabber != NULL)
{
pGrabber->Release();
pGrabber = NULL;
}
return hr;
}
// based on http://stackoverflow.com/questions/7383372/cant-make-iamstreamconfig-setformat-to-work-with-lifecam-studio
HRESULT CameraMethods::SetCaptureFormat(IBaseFilter* pCap, int width, int height)
{
HRESULT hr = S_OK;
IAMStreamConfig *pConfig = NULL;
hr = g_pCaptureGraphBuilder->FindInterface(
&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video,
pCap, // Pointer to the capture filter.
IID_IAMStreamConfig, (void**)&pConfig);
if (!SUCCEEDED(hr)) return hr;
int iCount = 0, iSize = 0;
hr = pConfig->GetNumberOfCapabilities(&iCount, &iSize);
if (!SUCCEEDED(hr)) return hr;
// Check the size to make sure we pass in the correct structure.
if (iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS))
{
// Use the video capabilities structure.
for (int iFormat = 0; iFormat < iCount; iFormat++)
{
VIDEO_STREAM_CONFIG_CAPS scc;
AM_MEDIA_TYPE *pmt;
/* Note: Use of the VIDEO_STREAM_CONFIG_CAPS structure to configure a video device is
deprecated. Although the caller must allocate the buffer, it should ignore the
contents after the method returns. The capture device will return its supported
formats through the pmt parameter. */
hr = pConfig->GetStreamCaps(iFormat, &pmt, (BYTE*)&scc);
if (SUCCEEDED(hr))
{
/* Examine the format, and possibly use it. */
if (pmt->formattype == FORMAT_VideoInfo) {
// Check the buffer size.
if (pmt->cbFormat >= sizeof(VIDEOINFOHEADER))
{
VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER*>(pmt->pbFormat);
BITMAPINFOHEADER *bmiHeader = &pVih->bmiHeader;
/* Access VIDEOINFOHEADER members through pVih. */
if( bmiHeader->biWidth == width && bmiHeader->biHeight == height &&
bmiHeader->biBitCount == 24)
{
hr = pConfig->SetFormat(pmt);
MyDeleteMediaType(pmt); break;
}
}
}
// Delete the media type when you are done.
MyDeleteMediaType(pmt);
}
}
}
return hr;
}
//*****************************************************************************************
// 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 DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{FD48314A-9615-4BA6-913A-03787FB2DD30}</ProjectGuid>
<RootNamespace>WebCamLib</RootNamespace>
<Keyword>ManagedCProj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)bin\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)bin\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>Strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>Strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>Strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\$(Configuration)\$(ProjectName).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>Strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="System">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Data">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Xml">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="WebCamLib.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="qedit.h" />
<ClInclude Include="WebCamLib.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?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!