Commit dd63eef5 by Liv Haapala

Merge branch 'master' of gitlab.codecrew.fi:liv/moya-info-tools

Conflicts:
	MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
	MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.dll
	MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.pdb
	MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.Designer.cs
2 parents 258f0580 f8150914
Showing with 12043 additions and 13 deletions
...@@ -61,6 +61,8 @@ namespace MoyaAdminLib ...@@ -61,6 +61,8 @@ namespace MoyaAdminLib
ContentType = "application/json"; ContentType = "application/json";
PostData = postData; PostData = postData;
} }
public static string CalculateSHA1(string text) public static string CalculateSHA1(string text)
{ {
// Convert the input string to a byte array // Convert the input string to a byte array
...@@ -87,21 +89,41 @@ namespace MoyaAdminLib ...@@ -87,21 +89,41 @@ namespace MoyaAdminLib
return (int)span.TotalSeconds; 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); 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); Console.WriteLine(url);
return 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 ///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(); request.Method = Method.ToString();
...@@ -151,7 +173,8 @@ namespace MoyaAdminLib ...@@ -151,7 +173,8 @@ namespace MoyaAdminLib
} }
catch (WebException e) catch (WebException e)
{ {
if (e.Status == WebExceptionStatus.ConnectFailure)
throw e;
Stream responseStream = ((WebException)e).Response.GetResponseStream(); Stream responseStream = ((WebException)e).Response.GetResponseStream();
if (responseStream != null) if (responseStream != null)
......
...@@ -15,7 +15,10 @@ namespace MoyaAdminLib ...@@ -15,7 +15,10 @@ namespace MoyaAdminLib
{ {
APIreference = user; APIreference = user;
} }
public User()
{
APIreference = new Eventuser();
}
private Eventuser APIreference; private Eventuser APIreference;
public Eventuser APIReference public Eventuser APIReference
{ {
...@@ -28,11 +31,13 @@ namespace MoyaAdminLib ...@@ -28,11 +31,13 @@ namespace MoyaAdminLib
{ {
get { return APIreference.eventuserId; } get { return APIreference.eventuserId; }
} }
/* /// <summary>
/// User global id. Usual you want event user id!
/// </summary>
public int UserId public int UserId
{ {
get { return APIreference.userId; } get { return APIreference.userId; }
}*/ }
public string Nick public string Nick
{ {
...@@ -54,10 +59,44 @@ namespace MoyaAdminLib ...@@ -54,10 +59,44 @@ namespace MoyaAdminLib
get { return APIreference.login; } 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() public override string ToString()
{ {
return this.Firstname + " "+ Lastname; return this.Firstname + " " + Lastname;
} }
public static List<User> Cache = new List<User>(); public static List<User> Cache = new List<User>();
public static void LoadAll() public static void LoadAll()
......
...@@ -7,6 +7,20 @@ using System.Threading.Tasks; ...@@ -7,6 +7,20 @@ using System.Threading.Tasks;
namespace MoyaAdminLib namespace MoyaAdminLib
{ {
//"eventuserId":7019,"firstname":"Topi","lastname":"Kinnunen","login":"xxtopotxx","userId":4902,"nick":"xXtopotXx"}, //"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 class Eventuser
{ {
public int eventuserId; public int eventuserId;
...@@ -15,6 +29,12 @@ namespace MoyaAdminLib ...@@ -15,6 +29,12 @@ namespace MoyaAdminLib
public string login; public string login;
public int userId; public int userId;
public string nick; public string nick;
public string birthday;
public string gender;
public string phoneNumber;
public string streetAddress;
public string zipCode;
public string postOffice;
} }
} }
...@@ -19,3 +19,5 @@ D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib ...@@ -19,3 +19,5 @@ 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.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\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.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.csprojResolveAssemblyReference.cache
I:\devel\proj\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 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}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminUI", "MoyaAdminUI\MoyaAdminUI.csproj", "{56D4C2A6-B4A2-4E40-ACFB-19E188AAD703}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminLib", "MoyaAdminLib\MoyaAdminLib.csproj", "{095CE28F-5B53-4203-85C6-3A9AFD486407}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminLib", "MoyaAdminLib\MoyaAdminLib.csproj", "{095CE28F-5B53-4203-85C6-3A9AFD486407}"
......
...@@ -75,7 +75,8 @@ ...@@ -75,7 +75,8 @@
// placesContextMenuStrip // placesContextMenuStrip
// //
this.placesContextMenuStrip.Name = "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 // MapPictureBox
// //
...@@ -302,6 +303,9 @@ ...@@ -302,6 +303,9 @@
this.label2.Size = new System.Drawing.Size(46, 13); this.label2.Size = new System.Drawing.Size(46, 13);
this.label2.TabIndex = 9; this.label2.TabIndex = 9;
this.label2.Text = "Avoinna"; this.label2.Text = "Avoinna";
this.label2.Size = new System.Drawing.Size(50, 13);
this.label2.TabIndex = 9;
this.label2.Text = "Vapaana";
// //
// reservedPlacesCountTextBox // reservedPlacesCountTextBox
// //
......
...@@ -1265,6 +1265,11 @@ namespace MoyaAdminUI ...@@ -1265,6 +1265,11 @@ namespace MoyaAdminUI
refreshPlacesCountTexBoxes(); refreshPlacesCountTexBoxes();
} }
private void placesContextMenuStrip_Opening(object sender, CancelEventArgs e)
{
}
} }
......
namespace WebCam
{
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
public class API32
{
// API32 calls
[DllImport("avicap32.dll")] public static extern IntPtr capCreateCaptureWindowA(byte[] lpszWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, int nID);
[DllImport("avicap32.dll")] public static extern bool capGetDriverDescriptionA(short wDriver, byte[] lpszName, int cbName, byte[] lpszVer, int cbVer);
[DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, bool wParam, int lParam);
[DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, short wParam, int lParam);
[DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, short wParam, FrameEventHandler lParam);
[DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, ref BITMAPINFO lParam);
[DllImport("User32.dll")] public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);
[DllImport("avicap32.dll")]public static extern int capGetVideoFormat(IntPtr hWnd, IntPtr psVideoFormat, int wSize );
// Constants
public const int WM_USER = 0x400;
public const int WS_CHILD = 0x40000000;
public const int WS_VISIBLE = 0x10000000;
public const int SWP_NOMOVE = 0x2;
public const int SWP_NOZORDER = 0x4;
public const int WM_CAP_DRIVER_CONNECT = WM_USER + 10;
public const int WM_CAP_DRIVER_DISCONNECT = WM_USER + 11;
public const int WM_CAP_SET_CALLBACK_FRAME = WM_USER + 5;
public const int WM_CAP_SET_PREVIEW = WM_USER + 50;
public const int WM_CAP_SET_PREVIEWRATE = WM_USER + 52;
public const int WM_CAP_SET_VIDEOFORMAT = WM_USER + 45;
public const int WM_CAP_DLG_VIDEODISPLAY = 0x42b;
public const int WM_CAP_DLG_VIDEOFORMAT = 0x429;
public const int WM_CAP_DLG_VIDEOSOURCE = 0x42a;
// Structures
[StructLayout(LayoutKind.Sequential)] public struct VIDEOHDR
{
[MarshalAs(UnmanagedType.I4)] public int lpData;
[MarshalAs(UnmanagedType.I4)] public int dwBufferLength;
[MarshalAs(UnmanagedType.I4)] public int dwBytesUsed;
[MarshalAs(UnmanagedType.I4)] public int dwTimeCaptured;
[MarshalAs(UnmanagedType.I4)] public int dwUser;
[MarshalAs(UnmanagedType.I4)] public int dwFlags;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=4)] public int[] dwReserved;
}
[StructLayout(LayoutKind.Sequential)] public struct BITMAPINFOHEADER
{
[MarshalAs(UnmanagedType.I4)] public Int32 biSize ;
[MarshalAs(UnmanagedType.I4)] public Int32 biWidth ;
[MarshalAs(UnmanagedType.I4)] public Int32 biHeight ;
[MarshalAs(UnmanagedType.I2)] public short biPlanes;
[MarshalAs(UnmanagedType.I2)] public short biBitCount ;
[MarshalAs(UnmanagedType.I4)] public Int32 biCompression;
[MarshalAs(UnmanagedType.I4)] public Int32 biSizeImage;
[MarshalAs(UnmanagedType.I4)] public Int32 biXPelsPerMeter;
[MarshalAs(UnmanagedType.I4)] public Int32 biYPelsPerMeter;
[MarshalAs(UnmanagedType.I4)] public Int32 biClrUsed;
[MarshalAs(UnmanagedType.I4)] public Int32 biClrImportant;
}
[StructLayout(LayoutKind.Sequential)] public struct BITMAPINFO
{
[MarshalAs(UnmanagedType.Struct, SizeConst=40)] public BITMAPINFOHEADER bmiHeader;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1024)] public Int32[] bmiColors;
}
public delegate void FrameEventHandler(IntPtr lwnd, IntPtr lpVHdr);
// Public methods
public static object GetStructure(IntPtr ptr,ValueType structure)
{
return Marshal.PtrToStructure(ptr,structure.GetType());
}
public static object GetStructure(int ptr,ValueType structure)
{
return GetStructure(new IntPtr(ptr),structure);
}
public static void Copy(IntPtr ptr,byte[] data)
{
Marshal.Copy(ptr,data,0,data.Length);
}
public static void Copy(int ptr,byte[] data)
{
Copy(new IntPtr(ptr),data);
}
public static int SizeOf(object structure)
{
return Marshal.SizeOf(structure);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using ConfLib2;
using System.ComponentModel;
namespace RamaSignup
{
public class Config : ConfObject
{
public Config()
{
}
//Username
private string sqlUsername;
[
ConfValueAttribute(1, 32),
Description("Database username"),
Category("Database"),
DefaultValue((string)"vector_ilmo")
]
public string SqlUsername { get { return sqlUsername; } set { sqlUsername = value; } }
//Password
private string sqlPassword;
[
ConfValueAttribute(1, 64),
Description("Database password"),
Category("Database"),
DefaultValue((string)"ramakukka")
]
public string SqlPassword { get { return sqlPassword; } set { sqlPassword = value; } }
private string sqlDatabase;
[
ConfValueAttribute(1, 32),
Description("Database name"),
Category("Database"),
DefaultValue((string)"vector_ilmo_devel")
]
public string SqlDatabase { get { return sqlDatabase; } set { sqlDatabase = value; } }
private string sqlHost;
[
ConfValueAttribute(1, 64),
Description("Database address"),
Category("Database"),
DefaultValue((string)"sql.f-solutions.net")
]
public string SqlHost { get { return sqlHost; } set { sqlHost = value; } }
private int defaultGroup;
[
ConfValueAttribute(0, 65000),
Description("Default group to new player"),
Category("Defaults"),
DefaultValue((int)1)
]
public int DefaultGroup { get { return defaultGroup; } set { defaultGroup = value; } }
}
}
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Diagnostics;
namespace ImageFilters
{
public class ConvMatrix
{
public int TopLeft = 0, TopMid = 0, TopRight = 0;
public int MidLeft = 0, Pixel = 1, MidRight = 0;
public int BottomLeft = 0, BottomMid = 0, BottomRight = 0;
public int Factor = 1;
public int Offset = 0;
public void SetAll(int nVal)
{
TopLeft = TopMid = TopRight = MidLeft = Pixel = MidRight = BottomLeft = BottomMid = BottomRight = nVal;
}
}
public class BitmapFilter
{
public const short EDGE_DETECT_KIRSH = 1;
public const short EDGE_DETECT_PREWITT = 2;
public const short EDGE_DETECT_SOBEL = 3;
public enum Dimensions
{
Width,
Height
}
public enum AnchorPosition
{
Top,
Center,
Bottom,
Left,
Right,
Free
}
public static bool Invert(Bitmap b)
{
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
for(int y=0;y<b.Height;++y)
{
for(int x=0; x < nWidth; ++x )
{
p[0] = (byte)(255-p[0]);
++p;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
public static void Croplines(Bitmap b)
{
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
int[] arr = new int[9];
unsafe
{
int imgX = 323;
//byte red, green, blue;
// area borders
int l_line = b.Width/2 - imgX/2 -4;
int r_line = b.Width/2 + imgX/2 +2;
byte * p = (byte *)(void *)Scan0;
//int nOffset = ;
int step1 = l_line * 3;
int step2 = (r_line - l_line) * 3;
int step3 = ((b.Width - r_line) * 3) + stride - b.Width*3;
// skannataan rivit
for(int y=0;y<b.Height;++y)
{
p += step1;
p[2] = 255;
p[0] = 255;
p += step2;
p[2] = 255;
p[0] = 255;
p += step3;
}
}
b.UnlockBits(bmData);
}
public static bool GrayScale(Bitmap b)
{
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
byte red, green, blue;
for(int y=0;y<b.Height;++y)
{
for(int x=0; x < b.Width; ++x )
{
blue = p[0];
green = p[1];
red = p[2];
p[0] = p[1] = p[2] = (byte)(.299 * red + .587 * green + .114 * blue);
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
public static bool BlackWhite(Bitmap b, byte nThreshold)
{
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
byte red, green, blue;
for(int y=0;y<b.Height;++y)
{
for(int x=0; x < b.Width; ++x )
{
blue = p[0];
green = p[1];
red = p[2];
if (nThreshold<(.299 * red + .587 * green + .114 * blue))
{
p[0] = p[1] = p[2] = (byte)255;
}
else
{
p[0] = p[1] = p[2] = (byte)0;
}
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
public static bool Brightness(Bitmap b, int nBrightness)
{
if (nBrightness < -255 || nBrightness > 255)
return false;
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
int nVal = 0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
for(int y=0;y<b.Height;++y)
{
for(int x=0; x < nWidth; ++x )
{
nVal = (int) (p[0] + nBrightness);
if (nVal < 0) nVal = 0;
if (nVal > 255) nVal = 255;
p[0] = (byte)nVal;
++p;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
public static bool Contrast(Bitmap b, sbyte nContrast)
{
if (nContrast < -100) return false;
if (nContrast > 100) return false;
double pixel = 0, contrast = (100.0+nContrast)/100.0;
contrast *= contrast;
int red, green, blue;
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
for(int y=0;y<b.Height;++y)
{
for(int x=0; x < b.Width; ++x )
{
blue = p[0];
green = p[1];
red = p[2];
pixel = red/255.0;
pixel -= 0.5;
pixel *= contrast;
pixel += 0.5;
pixel *= 255;
if (pixel < 0) pixel = 0;
if (pixel > 255) pixel = 255;
p[2] = (byte) pixel;
pixel = green/255.0;
pixel -= 0.5;
pixel *= contrast;
pixel += 0.5;
pixel *= 255;
if (pixel < 0) pixel = 0;
if (pixel > 255) pixel = 255;
p[1] = (byte) pixel;
pixel = blue/255.0;
pixel -= 0.5;
pixel *= contrast;
pixel += 0.5;
pixel *= 255;
if (pixel < 0) pixel = 0;
if (pixel > 255) pixel = 255;
p[0] = (byte) pixel;
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
public static bool Gamma(Bitmap b, double red, double green, double blue)
{
if (red < .2 || red > 5) return false;
if (green < .2 || green > 5) return false;
if (blue < .2 || blue > 5) return false;
byte [] redGamma = new byte [256];
byte [] greenGamma = new byte [256];
byte [] blueGamma = new byte [256];
for (int i = 0; i< 256; ++i)
{
redGamma[i] = (byte)Math.Min(255, (int)(( 255.0 * Math.Pow(i/255.0, 1.0/red)) + 0.5));
greenGamma[i] = (byte)Math.Min(255, (int)(( 255.0 * Math.Pow(i/255.0, 1.0/green)) + 0.5));
blueGamma[i] = (byte)Math.Min(255, (int)(( 255.0 * Math.Pow(i/255.0, 1.0/blue)) + 0.5));
}
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
for(int y=0;y<b.Height;++y)
{
for(int x=0; x < b.Width; ++x )
{
p[2] = redGamma[ p[2] ];
p[1] = greenGamma[ p[1] ];
p[0] = blueGamma[ p[0] ];
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
public static bool Color(Bitmap b, int red, int green, int blue)
{
if (red < -255 || red > 255) return false;
if (green < -255 || green > 255) return false;
if (blue < -255 || blue > 255) return false;
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
int nPixel;
for(int y=0;y<b.Height;++y)
{
for(int x=0; x < b.Width; ++x )
{
nPixel = p[2] + red;
nPixel = Math.Max(nPixel, 0);
p[2] = (byte)Math.Min(255, nPixel);
nPixel = p[1] + green;
nPixel = Math.Max(nPixel, 0);
p[1] = (byte)Math.Min(255, nPixel);
nPixel = p[0] + blue;
nPixel = Math.Max(nPixel, 0);
p[0] = (byte)Math.Min(255, nPixel);
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
public static bool Conv3x3(Bitmap b, ConvMatrix m)
{
// Avoid divide by zero errors
if (0 == m.Factor) return false;
Bitmap bSrc = (Bitmap)b.Clone();
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
BitmapData bmSrc = bSrc.LockBits(new Rectangle(0, 0, bSrc.Width, bSrc.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
int stride2 = stride * 2;
System.IntPtr Scan0 = bmData.Scan0;
System.IntPtr SrcScan0 = bmSrc.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
byte * pSrc = (byte *)(void *)SrcScan0;
int nOffset = stride - b.Width*3;
int nWidth = b.Width - 2;
int nHeight = b.Height - 2;
int nPixel;
for(int y=0;y < nHeight;++y)
{
for(int x=0; x < nWidth; ++x )
{
nPixel = ( ( ( (pSrc[2] * m.TopLeft) + (pSrc[5] * m.TopMid) + (pSrc[8] * m.TopRight) +
(pSrc[2 + stride] * m.MidLeft) + (pSrc[5 + stride] * m.Pixel) + (pSrc[8 + stride] * m.MidRight) +
(pSrc[2 + stride2] * m.BottomLeft) + (pSrc[5 + stride2] * m.BottomMid) + (pSrc[8 + stride2] * m.BottomRight)) / m.Factor) + m.Offset);
if (nPixel < 0) nPixel = 0;
if (nPixel > 255) nPixel = 255;
p[5 + stride]= (byte)nPixel;
nPixel = ( ( ( (pSrc[1] * m.TopLeft) + (pSrc[4] * m.TopMid) + (pSrc[7] * m.TopRight) +
(pSrc[1 + stride] * m.MidLeft) + (pSrc[4 + stride] * m.Pixel) + (pSrc[7 + stride] * m.MidRight) +
(pSrc[1 + stride2] * m.BottomLeft) + (pSrc[4 + stride2] * m.BottomMid) + (pSrc[7 + stride2] * m.BottomRight)) / m.Factor) + m.Offset);
if (nPixel < 0) nPixel = 0;
if (nPixel > 255) nPixel = 255;
p[4 + stride] = (byte)nPixel;
nPixel = ( ( ( (pSrc[0] * m.TopLeft) + (pSrc[3] * m.TopMid) + (pSrc[6] * m.TopRight) +
(pSrc[0 + stride] * m.MidLeft) + (pSrc[3 + stride] * m.Pixel) + (pSrc[6 + stride] * m.MidRight) +
(pSrc[0 + stride2] * m.BottomLeft) + (pSrc[3 + stride2] * m.BottomMid) + (pSrc[6 + stride2] * m.BottomRight)) / m.Factor) + m.Offset);
if (nPixel < 0) nPixel = 0;
if (nPixel > 255) nPixel = 255;
p[3 + stride] = (byte)nPixel;
p += 3;
pSrc += 3;
}
p += nOffset;
pSrc += nOffset;
}
}
b.UnlockBits(bmData);
bSrc.UnlockBits(bmSrc);
return true;
}
public static bool Smooth(Bitmap b, int nWeight /* default to 1 */)
{
ConvMatrix m = new ConvMatrix();
m.SetAll(1);
m.Pixel = nWeight;
m.Factor = nWeight + 8;
return BitmapFilter.Conv3x3(b, m);
}
public static bool GaussianBlur(Bitmap b, int nWeight /* default to 4*/)
{
ConvMatrix m = new ConvMatrix();
m.SetAll(1);
m.Pixel = nWeight;
m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = 2;
m.Factor = nWeight + 12;
return BitmapFilter.Conv3x3(b, m);
}
public static bool MeanRemoval(Bitmap b, int nWeight /* default to 9*/ )
{
ConvMatrix m = new ConvMatrix();
m.SetAll(-1);
m.Pixel = nWeight;
m.Factor = nWeight - 8;
return BitmapFilter.Conv3x3(b, m);
}
public static bool Sharpen(Bitmap b, int nWeight /* default to 11*/ )
{
ConvMatrix m = new ConvMatrix();
m.SetAll(0);
m.Pixel = nWeight;
m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = -2;
m.Factor = nWeight - 8;
return BitmapFilter.Conv3x3(b, m);
}
public static bool EmbossLaplacian(Bitmap b)
{
ConvMatrix m = new ConvMatrix();
m.SetAll(-1);
m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = 0;
m.Pixel = 4;
m.Offset = 127;
return BitmapFilter.Conv3x3(b, m);
}
public static bool EdgeDetectQuick(Bitmap b)
{
ConvMatrix m = new ConvMatrix();
m.TopLeft = m.TopMid = m.TopRight = -1;
m.MidLeft = m.Pixel = m.MidRight = 0;
m.BottomLeft = m.BottomMid = m.BottomRight = 1;
m.Offset = 127;
return BitmapFilter.Conv3x3(b, m);
}
public static bool EdgeDetectConvolution(Bitmap b, short nType, byte nThreshold)
{
ConvMatrix m = new ConvMatrix();
// I need to make a copy of this bitmap BEFORE I alter it 80)
Bitmap bTemp = (Bitmap)b.Clone();
switch (nType)
{
case EDGE_DETECT_SOBEL:
m.SetAll(0);
m.TopLeft = m.BottomLeft = 1;
m.TopRight = m.BottomRight = -1;
m.MidLeft = 2;
m.MidRight = -2;
m.Offset = 0;
break;
case EDGE_DETECT_PREWITT:
m.SetAll(0);
m.TopLeft = m.MidLeft = m.BottomLeft = -1;
m.TopRight = m.MidRight = m.BottomRight = 1;
m.Offset = 0;
break;
case EDGE_DETECT_KIRSH:
m.SetAll(-3);
m.Pixel = 0;
m.TopLeft = m.MidLeft = m.BottomLeft = 5;
m.Offset = 0;
break;
}
BitmapFilter.Conv3x3(b, m);
switch (nType)
{
case EDGE_DETECT_SOBEL:
m.SetAll(0);
m.TopLeft = m.TopRight = 1;
m.BottomLeft = m.BottomRight = -1;
m.TopMid = 2;
m.BottomMid = -2;
m.Offset = 0;
break;
case EDGE_DETECT_PREWITT:
m.SetAll(0);
m.BottomLeft = m.BottomMid = m.BottomRight = -1;
m.TopLeft = m.TopMid = m.TopRight = 1;
m.Offset = 0;
break;
case EDGE_DETECT_KIRSH:
m.SetAll(-3);
m.Pixel = 0;
m.BottomLeft = m.BottomMid = m.BottomRight = 5;
m.Offset = 0;
break;
}
BitmapFilter.Conv3x3(bTemp, m);
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
BitmapData bmData2 = bTemp.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
System.IntPtr Scan02 = bmData2.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
byte * p2 = (byte *)(void *)Scan02;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
int nPixel = 0;
for(int y=0;y<b.Height;++y)
{
for(int x=0; x < nWidth; ++x )
{
nPixel = (int) Math.Sqrt((p[0]*p[0]) + (p2[0] * p2[0]));
if (nPixel<nThreshold)nPixel = nThreshold;
if (nPixel>255) nPixel = 255;
p[0] = (byte) nPixel;
++p;
++p2;
}
p += nOffset;
p2 += nOffset;
}
}
b.UnlockBits(bmData);
bTemp.UnlockBits(bmData2);
return true;
}
public static bool EdgeDetectHorizontal(Bitmap b)
{
Bitmap bmTemp = (Bitmap)b.Clone();
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
BitmapData bmData2 = bmTemp.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
System.IntPtr Scan02 = bmData2.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
byte * p2 = (byte *)(void *)Scan02;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
int nPixel = 0;
p += stride;
p2 += stride;
for(int y=1;y<b.Height-1;++y)
{
p += 9;
p2 += 9;
for(int x=9; x < nWidth-9; ++x )
{
nPixel = ((p2 + stride - 9)[0] +
(p2 + stride - 6)[0] +
(p2 + stride - 3)[0] +
(p2 + stride)[0] +
(p2 + stride + 3)[0] +
(p2 + stride + 6)[0] +
(p2 + stride + 9)[0] -
(p2 - stride - 9)[0] -
(p2 - stride - 6)[0] -
(p2 - stride - 3)[0] -
(p2 - stride)[0] -
(p2 - stride + 3)[0] -
(p2 - stride + 6)[0] -
(p2 - stride + 9)[0]);
if (nPixel < 0) nPixel = 0;
if (nPixel > 255) nPixel = 255;
(p+stride)[0] = (byte) nPixel;
++ p;
++ p2;
}
p += 9 + nOffset;
p2 += 9 + nOffset;
}
}
b.UnlockBits(bmData);
bmTemp.UnlockBits(bmData2);
return true;
}
public static bool EdgeDetectVertical(Bitmap b)
{
Bitmap bmTemp = (Bitmap)b.Clone();
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
BitmapData bmData2 = bmTemp.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
System.IntPtr Scan02 = bmData2.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
byte * p2 = (byte *)(void *)Scan02;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
int nPixel = 0;
int nStride2 = stride *2;
int nStride3 = stride * 3;
p += nStride3;
p2 += nStride3;
for(int y=3;y<b.Height-3;++y)
{
p += 3;
p2 += 3;
for(int x=3; x < nWidth-3; ++x )
{
nPixel = ((p2 + nStride3 + 3)[0] +
(p2 + nStride2 + 3)[0] +
(p2 + stride + 3)[0] +
(p2 + 3)[0] +
(p2 - stride + 3)[0] +
(p2 - nStride2 + 3)[0] +
(p2 - nStride3 + 3)[0] -
(p2 + nStride3 - 3)[0] -
(p2 + nStride2 - 3)[0] -
(p2 + stride - 3)[0] -
(p2 - 3)[0] -
(p2 - stride - 3)[0] -
(p2 - nStride2 - 3)[0] -
(p2 - nStride3 - 3)[0]);
if (nPixel < 0) nPixel = 0;
if (nPixel > 255) nPixel = 255;
p[0] = (byte) nPixel;
++ p;
++ p2;
}
p += 3 + nOffset;
p2 += 3 + nOffset;
}
}
b.UnlockBits(bmData);
bmTemp.UnlockBits(bmData2);
return true;
}
public static bool EdgeDetectHomogenity(Bitmap b, byte nThreshold)
{
// This one works by working out the greatest difference between a pixel and it's eight neighbours.
// The threshold allows softer edges to be forced down to black, use 0 to negate it's effect.
Bitmap b2 = (Bitmap) b.Clone();
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
BitmapData bmData2 = b2.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
System.IntPtr Scan02 = bmData2.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
byte * p2 = (byte *)(void *)Scan02;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
int nPixel = 0, nPixelMax = 0;
p += stride;
p2 += stride;
for(int y=1;y<b.Height-1;++y)
{
p += 3;
p2 += 3;
for(int x=3; x < nWidth-3; ++x )
{
nPixelMax = Math.Abs(p2[0] - (p2+stride-3)[0]);
nPixel = Math.Abs(p2[0] - (p2 + stride)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs(p2[0] - (p2 + stride + 3)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs(p2[0] - (p2 - stride)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs(p2[0] - (p2 + stride)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs(p2[0] - (p2 - stride - 3)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs(p2[0] - (p2 - stride)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs(p2[0] - (p2 - stride + 3)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
if (nPixelMax < nThreshold) nPixelMax = 0;
p[0] = (byte) nPixelMax;
++ p;
++ p2;
}
p += 3 + nOffset;
p2 += 3 + nOffset;
}
}
b.UnlockBits(bmData);
b2.UnlockBits(bmData2);
return true;
}
public static bool EdgeDetectDifference(Bitmap b, byte nThreshold)
{
// This one works by working out the greatest difference between a pixel and it's eight neighbours.
// The threshold allows softer edges to be forced down to black, use 0 to negate it's effect.
Bitmap b2 = (Bitmap) b.Clone();
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
BitmapData bmData2 = b2.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
System.IntPtr Scan02 = bmData2.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
byte * p2 = (byte *)(void *)Scan02;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
int nPixel = 0, nPixelMax = 0;
p += stride;
p2 += stride;
for(int y=1;y<b.Height-1;++y)
{
p += 3;
p2 += 3;
for(int x=3; x < nWidth-3; ++x )
{
nPixelMax = Math.Abs((p2 - stride + 3)[0] - (p2+stride-3)[0]);
nPixel = Math.Abs((p2 + stride + 3)[0] - (p2 - stride - 3)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs((p2 - stride)[0] - (p2 + stride)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs((p2+3)[0] - (p2 - 3)[0]);
if (nPixel>nPixelMax) nPixelMax = nPixel;
if (nPixelMax < nThreshold) nPixelMax = 0;
p[0] = (byte) nPixelMax;
++ p;
++ p2;
}
p += 3 + nOffset;
p2 += 3 + nOffset;
}
}
b.UnlockBits(bmData);
b2.UnlockBits(bmData2);
return true;
}
public static bool EdgeEnhance(Bitmap b, byte nThreshold)
{
// This one works by working out the greatest difference between a nPixel and it's eight neighbours.
// The threshold allows softer edges to be forced down to black, use 0 to negate it's effect.
Bitmap b2 = (Bitmap) b.Clone();
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
BitmapData bmData2 = b2.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
System.IntPtr Scan02 = bmData2.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
byte * p2 = (byte *)(void *)Scan02;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
int nPixel = 0, nPixelMax = 0;
p += stride;
p2 += stride;
for (int y = 1; y < b.Height-1; ++y)
{
p += 3;
p2 += 3;
for (int x = 3; x < nWidth-3; ++x)
{
nPixelMax = Math.Abs((p2 - stride + 3)[0] - (p2 + stride - 3)[0]);
nPixel = Math.Abs((p2 + stride + 3)[0] - (p2 - stride - 3)[0]);
if (nPixel > nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs((p2 - stride)[0] - (p2 + stride)[0]);
if (nPixel > nPixelMax) nPixelMax = nPixel;
nPixel = Math.Abs((p2 + 3)[0] - (p2 - 3)[0]);
if (nPixel > nPixelMax) nPixelMax = nPixel;
if (nPixelMax > nThreshold && nPixelMax > p[0])
p[0] = (byte) Math.Max(p[0], nPixelMax);
++ p;
++ p2;
}
p += nOffset + 3;
p2 += nOffset + 3;
}
}
b.UnlockBits(bmData);
b2.UnlockBits(bmData2);
return true;
}
public static Image Crop(Image imgPhoto, int Width, int Height, AnchorPosition Anchor)
{
//Scale crop
int sourceWidth = imgPhoto.Width;
int sourceHeight = imgPhoto.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);
if (nPercentH < nPercentW)
{
nPercent = nPercentW;
switch (Anchor)
{
case AnchorPosition.Top:
destY = 0;
break;
case AnchorPosition.Bottom:
destY = (int)
(Height - (sourceHeight * nPercent));
break;
default:
destY = (int)
((Height - (sourceHeight * nPercent)) / 2);
break;
}
}
else
{
nPercent = nPercentH;
switch (Anchor)
{
case AnchorPosition.Left:
destX = 0;
break;
case AnchorPosition.Right:
destX = (int)
(Width - (sourceWidth * nPercent));
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(imgPhoto.HorizontalResolution,
imgPhoto.VerticalResolution);
Graphics grPhoto = Graphics.FromImage(bmPhoto);
grPhoto.InterpolationMode =
InterpolationMode.HighQualityBicubic;
grPhoto.DrawImage(imgPhoto,
new Rectangle(destX, destY, destWidth, destHeight),
new Rectangle(sourceX, sourceY, sourceWidth, sourceHeight),
GraphicsUnit.Pixel);
grPhoto.Dispose();
return bmPhoto;
}
public static Image Crop(Image imgPhoto, int Width, int Height, AnchorPosition Anchor, int x, int y)
{
// Size crop
int sourceWidth = imgPhoto.Width;
int sourceHeight = imgPhoto.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(imgPhoto.HorizontalResolution,
imgPhoto.VerticalResolution);
Graphics grPhoto = Graphics.FromImage(bmPhoto);
grPhoto.InterpolationMode =
InterpolationMode.HighQualityBicubic;
grPhoto.DrawImage(imgPhoto,
new Rectangle(0,0,destWidth,destHeight),
new Rectangle(sourceX, sourceY, destWidth, destHeight),
GraphicsUnit.Pixel);
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;
}
}
}
namespace RamaSignup
{
partial class Form1
{
/// <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 Windows Form 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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.btnFinnish = new System.Windows.Forms.Button();
this.btnEnglish = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.userDetailsEditor1 = new RamaSignup.UserDetailsEditor();
this.userLoginControl1 = new RamaSignup.UserLoginControl();
this.SuspendLayout();
//
// btnFinnish
//
this.btnFinnish.Image = ((System.Drawing.Image)(resources.GetObject("btnFinnish.Image")));
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.Visible = false;
//
// btnEnglish
//
this.btnEnglish.Image = ((System.Drawing.Image)(resources.GetObject("btnEnglish.Image")));
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.Visible = false;
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1, 1);
this.panel1.TabIndex = 86;
//
// 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(1046, 758);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(10, 10);
this.button1.TabIndex = 95;
this.button1.TabStop = false;
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(1058, 768);
this.Controls.Add(this.userDetailsEditor1);
this.Controls.Add(this.userLoginControl1);
this.Controls.Add(this.button1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.btnEnglish);
this.Controls.Add(this.btnFinnish);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form1";
this.Text = "Form1";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Deactivate += new System.EventHandler(this.Form1_Deactivate);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
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);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnFinnish;
private System.Windows.Forms.Button btnEnglish;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private UserLoginControl userLoginControl1;
private UserDetailsEditor userDetailsEditor1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WebCam;
using ImageFilters;
using NpgsqlAltPool;
using DynamicPg;
using Npgsql;
using System.IO;
using MoyaAdminLib;
namespace RamaSignup
{
public partial class Form1 : Form
{
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();
}
enum Language
{
Finnish = 0,
English = 1,
}
// Language currentLanguage = Language.English;
/*
void changed()
{
if (!pictureTaken )
{
this.lblMessage.Text = "Ota kuva ensin painamalla 'Käytä tätä kuvaa' nappia";
this.lblMessage.ForeColor = Color.Red;
this.btnSave.Enabled = false;
return;
}
this.lblMessage.ForeColor = Color.Green;
this.lblMessage.Text = "OK, varmista tietojen oikeellisuus ja tallenna";
this.btnSave.Enabled = true;
}*/
private void Form1_Load(object sender, EventArgs e)
{
if (AutoUpdateLib.AutoUpdateCore.CheckForUpdates(null))
{
Application.ExitThread(); //program is required to close by autoupdate (probably updated)
return;
}
}
bool pictureTaken;
private void btnFinnish_Click(object sender, EventArgs e)
{
}
private void btnEnglish_Click(object sender, EventArgs e)
{
}
bool checkSaveSafety()
{
return true;
}
/*
private void btnSave_Click(object sender, EventArgs e)
{
if (!checkSaveSafety())
{
this.btnSave.Enabled = false;
return;
}
this.Cursor = Cursors.WaitCursor;
this.btnSave.Enabled = false;
this.Enabled = false;
this.btnSave.Refresh();
//savePicture(pid);
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;
}*/
bool allowShutdown;
/*
private void txtName_TextChanged(object sender, EventArgs e)
{
changed();
}*/
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (!allowShutdown)
{
e.Cancel = true;
}
else
{
}
}
private void Form1_Deactivate(object sender, EventArgs e)
{
if (!allowShutdown)
this.Activate();
}
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
{
allowShutdown = true;
Application.Exit();
return;
}
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
{
allowShutdown = true;
this.Close();
return;
}
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
/* if (e.Button == MouseButtons.Right)
{
allowShutdown = true;
Application.Exit();
return;
}*/
}
private void button1_Click(object sender, EventArgs e)
{
allowShutdown = true;
Application.Exit();
}
private void userLoginControl1_LoginOk(object sender, EventArgs e)
{
userLoginControl1.Visible = false;
userDetailsEditor1.LoadUser(userLoginControl1.CurrentUser);
userLoginControl1.Clear();
userDetailsEditor1.Visible = true;
//userLoginControl1.CurrentUser;
}
private void userDetailsEditor1_Load(object sender, EventArgs e)
{
}
private void userDetailsEditor1_CloseView(object sender, EventArgs e)
{
userDetailsEditor1.Visible = false;
userLoginControl1.Visible = true;
}
}
}
<?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>
<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
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAASFJREFUeF7tmqEN
AkEUBbcp+qAYxEmKgB4IGnmSFjA0sxgE4jkIkDczyZgn9pIb+8f8Ey7X+xyb/UddDuvzdXnF6ECMDsTo
QIwOxOhAjA7E6ECMDsToQIwOxOhAjA7E6ECMDsToQIwOxOhAjA7E6ECMDsToQIwOxOhAjA7E6ECMDmSc
19v8B5fjGsO943Z3it+iO9LP0nLjqN3GUbuNo3YbR+02jtptHLXbOGq3cdRu46jdxlG7jaN2G0ftNo7a
bRy12zhqt3HUbuOo3cZRu42jdpsO536hh5Hf0xNoIEYHYnQgRgdidCBGB2J0IEYHYnQgRgdidCBGB2J0
IEYHYnQgRgdidCBGB2J0IEYHYnQgRgdidCBGB2J0IEYHYnQccz4AtRiZOblFrIsAAAAASUVORK5CYII=
</value>
</data>
<data name="btnEnglish.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAH0AAAA/CAYAAADNEMdCAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAACrdJREFUeF7tnYtz
VNUdx7fPv6DvqmhFwKmgIhQoYq0MOAqUUial2lIzDFIL1TKtWqWU0idjS1GGooKlaSsSgkCIEQXTCAgy
NLyy2exuks2DhA0hJCFPEpKQ/Hq/J+dk7+6ebM652Ww2u/c78x0mN7n3/s75hE1y9/y+x+FbmEqtJ0+T
ro6cKqeZS94gx9jfxJWbWjp4hX0qmbeUzn/u68rG15uF68nuM5LGvOd8XMorJOrt7KL6f2VQ4d2zpWMS
9i14glpP5JGj/8CiZdR26iy/jLpyT5bRjJTt0uJGwokMHfN8+LiPV2bA7uqm+jf3kvveudKxCGNMrR+d
4mdRALpw6eLl1Pa/c/zT6so5UUrTFm+TFhtLJyJ0zOv7x0p4RQbs7hvU8NZ+ck8eBPajP6KWoyf5WQGF
QRcuTXmS2vLy+Zep69BHPpr6vdelxcfCiQQd83jwSDGvhMNOzyT3fQ9LaxcueeRxavnwY35WuByuOx+Q
nihc9v2f0LUzTv7l6sJ35pRFsYefCNAxb9kfFvEKOOzdWeSZ+oi0ZuHihx+j5tzj/KyB5ehp76DarWnk
mjBLeiHhsh/8lK6dc/HT1NTb20sHj5bQ5IWvSgc3HB7N0DFP7+QWsXmDem/0UEPGO+SZNi+sTrOL5yyh
5pxj7BwVOfi/1HOtnWq3/JNc4++XXli47IerqN3p5mepCYPINgZzz4Kt0sFG06MROublQI63Hzb19NDV
t7PJMz0y7KKHUqj50JG+czTkmP/kTjpd4OcfGvdru0a1m/9BrnER4H/+Lipf+jS1u7z8LDVhUFnG4CbN
/7t08NHwaIKOedh/2BMMe99B8s6YL61NuOjBxdT0Xi4mtO88ReV7agi8Hbj5J+5YRwtW7KSzhZf4p/vg
X355uwF/pvTGzID/xDPU7g78sqEiDDLzAw9NnBd9+KMBOsa995A7CHZj5vvknfkdaU3CRQ8soqZ3/6sN
u6ColvEFZ1aDuRgcXPjUW3Te+I4Q6mlto8ubtlHBHd+UFsJswK9IXU0dnsCfFSrCoDH4ux7d0l/DUB3P
0DHOPe8VGoxNsLMOkXfWd6W1COPzjdkfaMMuLLnCePbDFg76gBtftGjlLnJ6L/PTiW60tFLNxteoYOwM
aWHMX5hIFct+YQl+xkEXTZi7OawWXccjdIwrPbsgANsYLyAqwTa+KfDNoSOPr47xC4MtLD3IjZMWr0o3
Xh5M8JsN+H/ZSgW3T5cWygz4y39JHUWBR4UqAvxdxuSMn2MdfjxBxzh2ZjmDYOPlGS/TsnsL42UeL/e6
sL2ldYzXgLCFpQdD/Mlx6yjl6d3kKq7llzfgNzZTzYYtVHDbNGnhzAb8Cyueo46Scn6WmjBJmKxxc16R
1hPJ8QAddf8nM59uGH9yMQG28YsXfgGT3VMYv8DhFzld2EXl9YwPOMnqCbP04ADGRZf8PIPcviv8dgb8
q0106U+byXnrN6QDYQb8p35F130V/Cw1Af6bB/Jp7OyXpfXIPJLQUee/95+nbgHbUPPho1Q8O0V6L2H8
aYY/0XRhl1xoYDyUYQtLDw5i3OSx1XuM77A6fnui7oZGuvTHV8g5Zqp0YHD+FydS5coX6HqpPnxM5te+
vUlaj9kjAR11pe07Fww75xh7aCK7hzAeuuDhCx7C6Kis6iqbf23YwtKDiv7U+N/S0mf3UrHx8iLU3XCV
qn+/KTL8L02iylUv0vXySn6WmgA/be85uu3BgeHHEjrq2PH22WDYucfZ41DZtYXxOBWPVfF4VUflVY1s
vjHvsnqULT2o6U8bRfz4uX3kM15uhLrrDfjrN5LzlinSgcMM/s9+TZ0XLvKz1ISflTv2nKVbv/W3sFpi
AR33fSPjDHWZoOENDrzRIbumMN4owRsmurAv+JvY/GKeQ2uxZOlBi0ZRqc/vZy8/Qt11DVS97q/kvPk+
6UTADP4za6mzMvBkUEX4H7Z99xkaY4I/nNBxn23pp6mzywT76En2FqbsWsJ4CxRvherCrrrUzOYzarCF
pQeHaBS57IVMKr9ogn+lnvxrXyLnTZOlEwPnf/luqlq9jjqrqvlZagL819Pz6OZZG4cFOq772q68INhY
lDDYtd33zmGLHLDYQUcXa5rZ/EUdtrD0YJT8mQnrafmaA1Thb+TDIeqqrSP/mg2R4X/lHrr47O+oyx94
MqgiwDeDgYYKHdcLgn0ijy07kp0rjGVLdWkZbBmTjvyXW9h8Yd5k8xk1Sw9G2Z+9cz2tWJtl/Gwywa+p
Jf+LfybnVweB//wfqKs68HBIV0OFLoR1hFhPKDtHuHDSQ1S3I10bdnVtC5sfzJNs/qJuft+EVbSgJ5Js
6CG2oSeAbOjhsqGHOCmg47lwIlsGdjDLrpNIHnAJtO3EtQ09CW1DT0Lb0JPQNvQktA09CW1DT0Lb0JPQ
NvQktA09CW1DT0Lbz94lll0nkWy/yxZi+63VBJANPVw29BDb0BNANvRwxXQ1LFZ96girSrG6FKtMZYCE
I6VexhI6Vu1i9S5W8cquDWP1L1YBYzWwEFYJx3Q1rPRglCzWvWM9t44Y7DT12Euh0DXq0FCh43rmXjUV
Yb0+1u1HhH+TAX/NBtYHIIT+gFG77l10uKBTQ0dWYy8BBh0ow9nhgg4aXfidVX7WsYPOHdm9YAZ/7Uus
A0gInUGjpsMFRaL3Cj1YOmLheBZiLwEbvWWx7GVD75w2/Eo/69VDz57snjB6/dDzh94/IfQExm0vG4pC
VyW6K3XEYFuIvUS3KLpGR7JrFV2z/UkTikJ3Lrp0I8K/ZQrr9kXXrxC6geOma1X0p6NvWkcMtoXYS/wP
Qz94PPWno1++P1NGUejLR39+RPhjprI+f/T7CyEHYMT600USRWlloCAVWY29BGwkPcRzEgWSMrThl1aw
ZA4kdMhqgQEfCR9I+hDyltXFLokCN0HGCbJOtNSjFnuJ58LIaBECbEzmaMqcQUaONnxfBcvkQTaPrCYY
mT7I9kHGjxCyf4YtcwYXRXoRUoy0BNgWYi/xsxLpTKM5XSooSkxRSOFCGlck+EjzQqoX0r2EkPoVtXQp
kSOHfDItGbCtxF5ikjBZiZQjh1y8/jhQRSF/Dzl8EeHfPp3l+SHXTwh5f5Zz5HASEgeRPKglwLYQewnY
u99N7MRIxINqw/eUsATOiPDHzmBJnkj0FELSp3JiJL4IWaLIFNWSMRgrsZeAjclIpmzYoCBgRTH4qatZ
Bq+sZhjZvcjwRZavEDJ+B8yGxUGkBCMtWEtG8VZiLzFoDD6ZU6CRgq0LH2nbSN2OBB+p3UjvRoq3ENK9
g1Kgkf+NHHAtAbaF2EsMEvnmdt57nzEPyL/Xhu/ysrz9yPDvZ7n9ZvjI9Wd57/xjZeFPKuwoILuRcGjs
JQaFnQvsnR3kxrxg5wtt+E43lT2+MmwMZmOnDuzYgZ07hJShW4m9xCCwJ4m9h4uaMU/Y80YXPvbWwR47
svEIY48e7NWDPXsGhW419hK7Ddm7NVkz5s28D5uqsKsWdteSjUsYu3MNCN1q7CX2EbP3ZYuOMY/Y505X
2E8P++rJxgeHQbcae4nvTHsHxuEx5hU7XOoKO2liR83QMfZDV4u9nBsWe4m9P+29VmNjzDP2ttUV9tDF
XrpijA7V2Evs2mtOQsSuvvauyiNjzDt2tdZVX+plKv0f8Sq/NdbFdJIAAAAASUVORK5CYII=
</value>
</data>
</root>
\ 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>{7264F333-9419-4208-AA6D-223D4CE19C05}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RamaSignup</RootNamespace>
<AssemblyName>RamaSignup</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
<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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<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">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\AutoUpdate\src\AutoPublish\bin\Debug\AutoUpdateLib.dll</HintPath>
</Reference>
<Reference Include="ConfLib2, Version=1.0.1.23606, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\ConfLib2.dll</HintPath>
</Reference>
<Reference Include="DynamicPg, Version=1.3.7.31629, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\DynamicPg.dll</HintPath>
</Reference>
<Reference Include="Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\Mono.Security.dll</HintPath>
</Reference>
<Reference Include="Mono.Security.Protocol.Tls, Version=1.0.1528.33423, Culture=neutral, PublicKeyToken=4c884638a2b03853">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\Mono.Security.Protocol.Tls.dll</HintPath>
</Reference>
<Reference Include="Npgsql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\Npgsql.dll</HintPath>
</Reference>
<Reference Include="NpgsqlAltPool, Version=1.4.2.37006, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\NpgsqlAltPool.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Extensions" />
<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.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="API32.cs" />
<Compile Include="Conf.cs" />
<Compile Include="Filters.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="mjpeg\ByteArrayUtils.cs" />
<Compile Include="mjpeg\MJPEGConfiguration.cs" />
<Compile Include="mjpeg\MJPEGSource.cs" />
<Compile Include="mjpeg\MJPEGSourcePage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="mjpeg\SourceDescriptions.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="mjpeg\MJPEGSourcePage.resx">
<DependentUpon>MJPEGSourcePage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<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>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<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" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="vecto_tausta.png" />
</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>
<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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file

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
EndGlobalSection
EndGlobal
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace RamaSignup
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
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());
}
}
}
END
AssemblyInfo.cs
K 25
svn:wc:ra_dav:version-url
V 60
/RamaSignup/!svn/ver/8/RamaSignup/Properties/AssemblyInfo.cs
END
8
dir
7
https://svn.f-solutions.fi/RamaSignup/RamaSignup/Properties
https://svn.f-solutions.fi/RamaSignup
2008-06-12T08:56:20.852145Z
2
keitsi
svn:special svn:externals svn:needs-lock
7bcb2a89-324a-0410-94bb-9424dc35d795
AssemblyInfo.cs
file
8
2009-06-10T23:27:47.828125Z
55908c231febd4737b1bd4b099d66881
2010-02-19T12:46:56.698865Z
8
tapsa
Settings.settings
file
2008-04-06T11:23:25.361250Z
8c0f00d7d9b0046695a0255f1b11b061
2008-04-06T14:06:14.760617Z
1
tapsa
Settings.Designer.cs
file
2008-04-06T11:23:25.455000Z
451950b21d1a94aa3a8f3d556f447c0e
2008-04-06T14:06:14.760617Z
1
tapsa
Resources.resx
file
2008-06-14T00:36:46.203125Z
4c175e52a1bb28441b18470606ffd3a1
2008-06-12T08:56:20.852145Z
2
keitsi
Resources.Designer.cs
file
2008-06-14T00:36:46.203125Z
39abbef49c546afad0784686a9e6dccc
2008-06-12T08:56:20.852145Z
2
keitsi
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("RamaSignup")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Oem")]
[assembly: AssemblyProduct("RamaSignup")]
[assembly: AssemblyCopyright("Copyright © Oem 2008")]
[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("ed32fc66-2715-4f4d-a408-6161459efc9e")]
// 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.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RamaSignup.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RamaSignup.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static System.Drawing.Bitmap vecto_tausta {
get {
object obj = ResourceManager.GetObject("vecto_tausta", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
<?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=2.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>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="vecto_tausta" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\vecto_tausta.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RamaSignup.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?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>
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("RamaSignup")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Oem")]
[assembly: AssemblyProduct("RamaSignup")]
[assembly: AssemblyCopyright("Copyright © Oem 2008")]
[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("ed32fc66-2715-4f4d-a408-6161459efc9e")]
// 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.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
namespace RamaSignup.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RamaSignup.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap vecto_tausta {
get {
object obj = ResourceManager.GetObject("vecto_tausta", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
<?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=2.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>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="vecto_tausta" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\vecto_tausta.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
namespace RamaSignup.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[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())));
public static Settings Default {
get {
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)" 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RamaSignup
{
class TicketType
{
public int Id;
public string Description;
public TicketType(int id, string description)
{
this.Id = id;
this.Description = description;
}
public override string ToString()
{
return this.Description;
}
}
}
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="RamaSignup">
</Property><Property Name="Solution File" Value="D:\Devel\proj\moya-info-tools\MoyaSignup\RamaSignup.sln">
</Property><Property Name="Date" Value="6. kesäkuuta 2014">
</Property><Property Name="Time" Value="18:56">
</Property></Properties><Event ErrorLevel="0" Project="RamaSignup" Source="RamaSignup.csproj" Description="Project converted successfully">
</Event><Event ErrorLevel="3" Project="RamaSignup" Source="RamaSignup.csproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="RamaSignup.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="RamaSignup.sln" Description="Converted">
</Event><Event ErrorLevel="0" Project="RamaSignup" Source="RamaSignup.csproj" Description="Scan complete: Upgrade not required for project files.">
</Event></UpgradeLog>
\ 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.Collections.Generic;
using System.Linq;
using System.Text;
namespace RamaSignup
{
public static class Util
{
/// <summary>
/// Escapes SQL special characters from string using \
/// effectively preventing SQL injections.
/// </summary>
/// <param name="stringToEscape"></param>
/// <returns></returns>
public static string Esc(string stringToEscape)
{
return stringToEscape.Replace(@"\", @"\\").Replace("'", @"\'");
}
}
}
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
<xsl:key name="ProjectKey" match="Event" use="@Project" />
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution"><a _locID="Solution">Solution</a>: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)"><a _locID="Project">Project</a>: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
&#32;<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">Filename</td>
<td nowrap="1" class="header" _locID="Status">Status</td>
<td nowrap="1" class="header" _locID="Errors">Errors</td>
<td nowrap="1" class="header" _locID="Warnings">Warnings</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" _locID="IMG.alt" _locAttrData="alt" alt="expand/collapse section" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9" ><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A>&#32;<xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'"><a _locID="Converted1">Converted</a></xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0"><a _locID="Converted2">Converted</a>
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">Conversion Report - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/><a _locID="file1"> files</a>
</xsl:if>
<xsl:if test="count(source)=1">
<a _locID="file2">1 file</a>
</xsl:if>
</td>
<td class="foot">
<a _locID="Converted3">Converted</a>:&#32;<xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR />
<a _locID="NotConverted">Not converted</a>:&#32;<xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
<title _locID="ConversionReport0">Conversion Report&#32;
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">Conversion Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b _locID="TimeOfConversion">Time of Conversion:</b>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Date']/@Value"/>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b _locID="ConversionSettings">Conversion Settings</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<configuration>
<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"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<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>
<?xml version="1.0" encoding="utf-8"?>
<AutoPublishSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UploadUser>f-solu-06</UploadUser>
<UploadPath>/home/f-solu-06/software.f-solutions.fi</UploadPath>
<UploadHost>software.f-solutions.fi</UploadHost>
<ProjectName>RamaSignup</ProjectName>
<Customers>
<Customer>
<Name>vectorama</Name>
<Password>ramakukka</Password>
<AllowDevelopmentReleases>false</AllowDevelopmentReleases>
</Customer>
</Customers>
<ForceUpdate>false</ForceUpdate>
</AutoPublishSettings>
\ No newline at end of file
-----BEGIN CERTIFICATE-----
MIIECDCCA3GgAwIBAgICJBwwDQYJKoZIhvcNAQEFBQAwgbkxCzAJBgNVBAYTAi0t
MRIwEAYDVQQIEwlTb21lU3RhdGUxETAPBgNVBAcTCFNvbWVDaXR5MRkwFwYDVQQK
ExBTb21lT3JnYW5pemF0aW9uMR8wHQYDVQQLExZTb21lT3JnYW5pemF0aW9uYWxV
bml0MR0wGwYDVQQDExR3d3cuYWRtaW5pc3RyYXRvci5maTEoMCYGCSqGSIb3DQEJ
ARYZcm9vdEB3d3cuYWRtaW5pc3RyYXRvci5maTAeFw0wODAyMDIxOTQ0MjNaFw0w
OTAyMDExOTQ0MjNaMIG5MQswCQYDVQQGEwItLTESMBAGA1UECBMJU29tZVN0YXRl
MREwDwYDVQQHEwhTb21lQ2l0eTEZMBcGA1UEChMQU29tZU9yZ2FuaXphdGlvbjEf
MB0GA1UECxMWU29tZU9yZ2FuaXphdGlvbmFsVW5pdDEdMBsGA1UEAxMUd3d3LmFk
bWluaXN0cmF0b3IuZmkxKDAmBgkqhkiG9w0BCQEWGXJvb3RAd3d3LmFkbWluaXN0
cmF0b3IuZmkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALyTeTE1MCV7aIQF
eIw18c488OcjUh3WEUd9Nv7opg1Kkjd48YPPgbsrm/uqLITPOX+ftavJbcYYutbH
xcRET+9ZzbA/icqGSDXV4RW78w7mDrB9E6lXPaPwTYXt7EnjfJAZUjcCfTmHQ3jC
lsQELGY/my1b4Xqdpzlb2nCIXWyRAgMBAAGjggEbMIIBFzAdBgNVHQ4EFgQUqmur
HuSCOnltZ760q3QHTnU+rdkwgecGA1UdIwSB3zCB3IAUqmurHuSCOnltZ760q3QH
TnU+rdmhgb+kgbwwgbkxCzAJBgNVBAYTAi0tMRIwEAYDVQQIEwlTb21lU3RhdGUx
ETAPBgNVBAcTCFNvbWVDaXR5MRkwFwYDVQQKExBTb21lT3JnYW5pemF0aW9uMR8w
HQYDVQQLExZTb21lT3JnYW5pemF0aW9uYWxVbml0MR0wGwYDVQQDExR3d3cuYWRt
aW5pc3RyYXRvci5maTEoMCYGCSqGSIb3DQEJARYZcm9vdEB3d3cuYWRtaW5pc3Ry
YXRvci5maYICJBwwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCOuL+x
zuyL3RlS5Mrkerew/RoPgl9zwIt8wHc2X0Ra+0ZcYGysCicLo/3e+AA8ksUTVZjc
F9MAWQ0VcAbPVEFwKfdpWU0NdmhxpHBZX8kpn1NfR1HtS7TfRoBJ+M+RqliHgTJj
6DAdaE3br/LcDnf2eRZh8b3plR1FunU8dYRZiQ==
-----END CERTIFICATE-----
; NSIS script - ONLY for use with AutoPublish/AutoUpdate system
; //keitsi
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;Configuration
SetCompressor lzma
Name "<$PROJECTNAME$> v<$VERSION$> <$CUSTOMER$>"
; DO NOT CHANGE OutFile "installer_temp.exe" !!! AutoPublish requires this.
; AutoPublish will move the installer according to autopublish.xml file.
OutFile "installer_temp.exe"
;Folder selection page
InstallDir "$PROGRAMFILES\<$PROJECTNAME$>"
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\<$PROJECTNAME$>" ""
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
; !insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
; !define MUI_FINISHPAGE_RUN $INSTDIR\<$BINARYNAME$>
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Function GetDotNet
IfFileExists "$WINDIR\Microsoft.NET\Framework\v2.0.50727\installUtil.exe" NextStep
MessageBox MB_OK|MB_ICONEXCLAMATION "You must have the Microsoft .NET Framework 2.0 Installed to use this application. $\n$\nClick 'Open' in the following file dialog to download and run the Microsoft .NET Framework Installer..."
ExecShell Open "http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=0856eacb-4362-4b0d-8edd-aab15c5e04f5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f5%2f6%2f7%2f567758a3-759e-473e-bf8f-52154438565a%2fdotnetfx.exe" SW_SHOWNORMAL
Quit
NextStep:
FunctionEnd
Function .onInit
Call GetDotNet
FunctionEnd
Function .onInstSuccess
Exec '"$INSTDIR\<$BINARYNAME$>"'
FunctionEnd
Function WaitProgramClose
IfFileExists "$INSTDIR\<$BINARYNAME$>" loop NotInstalled
loop:
ClearErrors
Delete "$INSTDIR\<$BINARYNAME$>"
${If} ${Errors}
; Delete failed - means the program is still running. Sleep 2 seconds and retry.
Sleep 2000
ClearErrors
Delete "$INSTDIR\<$BINARYNAME$>"
${If} ${Errors}
MessageBox MB_OK "Program <$BINARYNAME$> didn't close in 2 seconds. Automatic update can't continue before it's closed. Please close the program manually and hit OK to retry."
goto loop
${EndIf}
${EndIf}
NotInstalled:
FunctionEnd
Section "!<$PROJECTNAME$> v<$VERSION$>" SecMain
SetOutPath "$INSTDIR"
Call WaitProgramClose
SetOverwrite off
File /oname=ramasignup.conf "<$BINARYDIR$>\ramasignup.conf"
SetOverwrite on
File /oname=autoupdate.xml "<$BINARYDIR$>\autoupdate.<$CUSTOMER$>.xml"
File /oname=<$BINARYNAME$> "<$BINARYDIR$>\<$BINARYNAME$>"
File /oname=RamaSignup.pdb "<$BINARYDIR$>\RamaSignup.pdb"
; File /oname=Npgsql.pdb "<$BINARYDIR$>\Npgsql.pdb"
; File /oname=NpgsqlAltPool.pdb "<$BINARYDIR$>\NpgsqlAltPool.pdb"
File /oname=AutoUpdateLib.pdb "<$BINARYDIR$>\AutoUpdateLib.pdb"
; File /oname=ConfLibSql.pdb "<$BINARYDIR$>\ConfLibSql.pdb"
File autoupdate.crt
;File "..\..\res\speexenc.exe"
; File "<$BINARYDIR$>\logo.jpg"
; this line will be replicated for every non-default existing assembly
; that is referenced to the main project.
File "<$REFERENCEDASSEMBLY$>"
WriteRegStr HKCU "Software\<$PROJECTNAME$>" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
;Create shortcuts
CreateDirectory "$SMPROGRAMS\<$PROJECTNAME$>"
CreateShortCut "$SMPROGRAMS\<$PROJECTNAME$>\<$PROJECTNAME$>.lnk" "$INSTDIR\<$BINARYNAME$>"
CreateShortCut "$SMPROGRAMS\<$PROJECTNAME$>\Uninstall <$PROJECTNAME$>.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Descriptions
LangString DESC_SecMain ${LANG_ENGLISH} "Base (required)"
;--------------------------------
;Uninstaller Section
Section "Uninstall"
Delete "$SMPROGRAMS\<$PROJECTNAME$>\*"
RMDir "$SMPROGRAMS\<$PROJECTNAME$>"
Delete "$INSTDIR\<$BINARYNAME$>"
Delete "$INSTDIR\autoupdate.xml"
Delete "$INSTDIR\autoupdate.crt"
Delete "$INSTDIR\speexenc.exe"
; this line will be replicated for every non-default existing assembly
; that is referenced to the main project.
Delete "$INSTDIR\<$REFERENCEDASSEMBLY$>"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
SectionEnd
\ No newline at end of file
8
dir
7
https://svn.f-solutions.fi/RamaSignup/RamaSignup/deps
https://svn.f-solutions.fi/RamaSignup
2008-06-12T08:56:20.852145Z
2
keitsi
svn:special svn:externals svn:needs-lock
7bcb2a89-324a-0410-94bb-9424dc35d795
DynamicPg.dll
file
2008-06-14T00:36:46.109375Z
70c8ed9f13c2298fbb1a55055a4e1a98
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
ConfLib2.dll
file
2008-06-14T00:36:46.125000Z
9c025bed10d8fc02b2b0329d827bfd6d
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
Mono.Security.dll
file
2008-06-14T00:36:46.125000Z
9644e30721a868e46a1e24330e05590c
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
Mono.Security.Protocol.Tls.dll
file
2008-06-14T00:36:46.140625Z
ef109ed9172ec910ab4af2a88e200f0b
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
NpgsqlAltPool.dll
file
2008-06-14T00:36:46.140625Z
3dedecb6c4267a4ed7ea860d1edc5444
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
SQLTools.dll
file
2008-06-14T00:36:46.140625Z
b07a308c2ea222c2f168cf1a940dea53
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
old
dir
Npgsql.dll
file
2008-06-14T00:36:46.140625Z
2713b75d74f0abf6edcd14d7442cd12e
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
8
dir
7
https://svn.f-solutions.fi/RamaSignup/RamaSignup/deps/old
https://svn.f-solutions.fi/RamaSignup
2008-06-12T08:56:20.852145Z
2
keitsi
svn:special svn:externals svn:needs-lock
7bcb2a89-324a-0410-94bb-9424dc35d795
K 25
svn:wc:ra_dav:version-url
V 39
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg
END
MJPEGSourcePage.resx
K 25
svn:wc:ra_dav:version-url
V 60
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/MJPEGSourcePage.resx
END
MJPEGSourcePage.cs
K 25
svn:wc:ra_dav:version-url
V 58
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/MJPEGSourcePage.cs
END
ByteArrayUtils.cs
K 25
svn:wc:ra_dav:version-url
V 57
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/ByteArrayUtils.cs
END
MJPEGSource.cs
K 25
svn:wc:ra_dav:version-url
V 54
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/MJPEGSource.cs
END
SourceDescriptions.cs
K 25
svn:wc:ra_dav:version-url
V 61
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/SourceDescriptions.cs
END
MJPEGConfiguration.cs
K 25
svn:wc:ra_dav:version-url
V 61
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/MJPEGConfiguration.cs
END
8
dir
8
https://svn.f-solutions.fi/RamaSignup/RamaSignup/mjpeg
https://svn.f-solutions.fi/RamaSignup
2010-02-19T12:46:56.698865Z
8
tapsa
svn:special svn:externals svn:needs-lock
MJPEGSourcePage.resx
file
2005-03-08T09:43:58.000000Z
77691a6c212340829b2b3342d4b24161
2010-02-19T12:46:56.698865Z
8
tapsa
MJPEGSourcePage.cs
file
2006-10-09T19:24:56.000000Z
1781a147ed0503b3ff170e6ec3b8699d
2010-02-19T12:46:56.698865Z
8
tapsa
ByteArrayUtils.cs
file
2006-10-09T19:24:56.000000Z
12d0eaacb21f4564785a5413d2cbe4f8
2010-02-19T12:46:56.698865Z
8
tapsa
MJPEGSource.cs
file
2006-10-09T19:24:56.000000Z
6d074f39b147cf7ebcb40f6c469e637d
2010-02-19T12:46:56.698865Z
8
tapsa
SourceDescriptions.cs
file
2006-10-09T19:24:56.000000Z
3fb835fbaf7fbbd420a2d180f942567d
2010-02-19T12:46:56.698865Z
8
tapsa
MJPEGConfiguration.cs
file
2006-10-09T19:24:56.000000Z
f6e0ff9871617b5458172849a1e438e9
2010-02-19T12:46:56.698865Z
8
tapsa
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
/// <summary>
/// Some array utilities
/// </summary>
internal class ByteArrayUtils
{
// Check if the array contains needle on specified position
public static bool Compare(byte[] array, byte[] needle, int startIndex)
{
int needleLen = needle.Length;
// compare
for (int i = 0, p = startIndex; i < needleLen; i++, p++)
{
if (array[p] != needle[i])
{
return false;
}
}
return true;
}
// Find subarray in array
public static int Find(byte[] array, byte[] needle, int startIndex, int count)
{
int needleLen = needle.Length;
int index;
while (count >= needleLen)
{
index = Array.IndexOf(array, needle[0], startIndex, count - needleLen + 1);
if (index == -1)
return -1;
int i, p;
// check for needle
for (i = 0, p = index; i < needleLen; i++, p++)
{
if (array[p] != needle[i])
{
break;
}
}
if (i == needleLen)
{
// found needle
return index;
}
count -= (index - startIndex + 1);
startIndex = index + 1;
}
return -1;
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
/// <summary>
/// MJPEGConfiguration
/// </summary>
public class MJPEGConfiguration
{
public string source;
public string login;
public string password;
}
}
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Net;
using videosource;
/// <summary>
/// MJPEGSource - MJPEG stream support
/// </summary>
public class MJPEGSource : IVideoSource
{
private string source;
private string login = null;
private string password = null;
private object userData = null;
private int framesReceived;
private int bytesReceived;
private bool useSeparateConnectionGroup = true;
private const int bufSize = 512 * 1024; // buffer size
private const int readSize = 1024; // portion size to read
private Thread thread = null;
private ManualResetEvent stopEvent = null;
private ManualResetEvent reloadEvent = null;
// new frame event
public event CameraEventHandler NewFrame;
// SeparateConnectioGroup property
// indicates to open WebRequest in separate connection group
public bool SeparateConnectionGroup
{
get { return useSeparateConnectionGroup; }
set { useSeparateConnectionGroup = value; }
}
// VideoSource property
public string VideoSource
{
get { return source; }
set
{
source = value;
// signal to reload
if (thread != null)
reloadEvent.Set();
}
}
// Login property
public string Login
{
get { return login; }
set { login = value; }
}
// Password property
public string Password
{
get { return password; }
set { password = value; }
}
// FramesReceived property
public int FramesReceived
{
get
{
int frames = framesReceived;
framesReceived = 0;
return frames;
}
}
// BytesReceived property
public int BytesReceived
{
get
{
int bytes = bytesReceived;
bytesReceived = 0;
return bytes;
}
}
// UserData property
public object UserData
{
get { return userData; }
set { userData = value; }
}
// Get state of the video source thread
public bool Running
{
get
{
if (thread != null)
{
if (thread.Join(0) == false)
return true;
// the thread is not running, so free resources
Free();
}
return false;
}
}
// Constructor
public MJPEGSource()
{
}
// Start work
public void Start()
{
if (thread == null)
{
framesReceived = 0;
bytesReceived = 0;
// create events
stopEvent = new ManualResetEvent(false);
reloadEvent = new ManualResetEvent(false);
// create and start new thread
thread = new Thread(new ThreadStart(WorkerThread));
thread.Name = source;
thread.Start();
}
}
// Signal thread to stop work
public void SignalToStop()
{
// stop thread
if (thread != null)
{
// signal to stop
stopEvent.Set();
}
}
// Wait for thread stop
public void WaitForStop()
{
if (thread != null)
{
// wait for thread stop
thread.Join();
Free();
}
}
// Abort thread
public void Stop()
{
if (this.Running)
{
thread.Abort();
WaitForStop();
}
}
// Free resources
private void Free()
{
thread = null;
// release events
stopEvent.Close();
stopEvent = null;
reloadEvent.Close();
reloadEvent = null;
}
// Thread entry point
public void WorkerThread()
{
byte[] buffer = new byte[bufSize]; // buffer to read stream
while (true)
{
// reset reload event
reloadEvent.Reset();
HttpWebRequest req = null;
WebResponse resp = null;
Stream stream = null;
byte[] delimiter = null;
byte[] delimiter2 = null;
byte[] boundary = null;
int boundaryLen, delimiterLen = 0, delimiter2Len = 0;
int read, todo = 0, total = 0, pos = 0, align = 1;
int start = 0, stop = 0;
// align
// 1 = searching for image start
// 2 = searching for image end
try
{
// create request
req = (HttpWebRequest) WebRequest.Create(source);
// set login and password
if ((login != null) && (password != null) && (login != ""))
req.Credentials = new NetworkCredential(login, password);
// set connection group name
if (useSeparateConnectionGroup)
req.ConnectionGroupName = GetHashCode().ToString();
// get response
resp = req.GetResponse();
// check content type
string ct = resp.ContentType;
if (ct.IndexOf("multipart/x-mixed-replace") == -1)
throw new ApplicationException("Invalid URL");
// get boundary
ASCIIEncoding encoding = new ASCIIEncoding();
boundary = encoding.GetBytes(ct.Substring(ct.IndexOf("boundary=", 0) + 9));
boundaryLen = boundary.Length;
// get response stream
stream = resp.GetResponseStream();
// loop
while ((!stopEvent.WaitOne(0, true)) && (!reloadEvent.WaitOne(0, true)))
{
// check total read
if (total > bufSize - readSize)
{
total = pos = todo = 0;
}
// read next portion from stream
if ((read = stream.Read(buffer, total, readSize)) == 0)
throw new ApplicationException();
total += read;
todo += read;
// increment received bytes counter
bytesReceived += read;
// does we know the delimiter ?
if (delimiter == null)
{
// find boundary
pos = ByteArrayUtils.Find(buffer, boundary, pos, todo);
if (pos == -1)
{
// was not found
todo = boundaryLen - 1;
pos = total - todo;
continue;
}
todo = total - pos;
if (todo < 2)
continue;
// check new line delimiter type
if (buffer[pos + boundaryLen] == 10)
{
delimiterLen = 2;
delimiter = new byte[2] {10, 10};
delimiter2Len = 1;
delimiter2 = new byte[1] {10};
}
else
{
delimiterLen = 4;
delimiter = new byte[4] {13, 10, 13, 10};
delimiter2Len = 2;
delimiter2 = new byte[2] {13, 10};
}
pos += boundaryLen + delimiter2Len;
todo = total - pos;
}
// search for image
if (align == 1)
{
start = ByteArrayUtils.Find(buffer, delimiter, pos, todo);
if (start != -1)
{
// found delimiter
start += delimiterLen;
pos = start;
todo = total - pos;
align = 2;
}
else
{
// delimiter not found
todo = delimiterLen - 1;
pos = total - todo;
}
}
// search for image end
while ((align == 2) && (todo >= boundaryLen))
{
stop = ByteArrayUtils.Find(buffer, boundary, pos, todo);
if (stop != -1)
{
pos = stop;
todo = total - pos;
// increment frames counter
framesReceived ++;
// image at stop
if (NewFrame != null)
{
Bitmap bmp = (Bitmap) Bitmap.FromStream(new MemoryStream(buffer, start, stop - start));
// notify client
NewFrame(this, new CameraEventArgs(bmp));
// release the image
bmp.Dispose();
bmp = null;
}
// shift array
pos = stop + boundaryLen;
todo = total - pos;
Array.Copy(buffer, pos, buffer, 0, todo);
total = todo;
pos = 0;
align = 1;
}
else
{
// delimiter not found
todo = boundaryLen - 1;
pos = total - todo;
}
}
}
}
catch (WebException ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
// wait for a while before the next try
Thread.Sleep(250);
}
catch (ApplicationException ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
// wait for a while before the next try
Thread.Sleep(250);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
}
finally
{
// abort request
if (req != null)
{
req.Abort();
req = null;
}
// close response stream
if (stream != null)
{
stream.Close();
stream = null;
}
// close response
if (resp != null)
{
resp.Close();
resp = null;
}
}
// need to stop ?
if (stopEvent.WaitOne(0, true))
break;
}
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using videosource;
namespace mjpeg
{
/// <summary>
/// Summary description for MJPEGSourcePage.
/// </summary>
public class MJPEGSourcePage : System.Windows.Forms.UserControl, IVideoSourcePage
{
private bool completed = false;
private System.Windows.Forms.TextBox passwordBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox loginBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox urlBox;
private System.Windows.Forms.Label label1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
// new frame event
public event EventHandler StateChanged;
// Constructor
public MJPEGSourcePage()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitForm call
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(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.passwordBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.loginBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.urlBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// passwordBox
//
this.passwordBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.passwordBox.Location = new System.Drawing.Point(70, 70);
this.passwordBox.Name = "passwordBox";
this.passwordBox.Size = new System.Drawing.Size(220, 20);
this.passwordBox.TabIndex = 5;
this.passwordBox.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(10, 73);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(60, 14);
this.label3.TabIndex = 4;
this.label3.Text = "&Password:";
//
// loginBox
//
this.loginBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.loginBox.Location = new System.Drawing.Point(70, 40);
this.loginBox.Name = "loginBox";
this.loginBox.Size = new System.Drawing.Size(220, 20);
this.loginBox.TabIndex = 3;
this.loginBox.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(10, 43);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 14);
this.label2.TabIndex = 2;
this.label2.Text = "&Login:";
//
// urlBox
//
this.urlBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.urlBox.Location = new System.Drawing.Point(70, 10);
this.urlBox.Name = "urlBox";
this.urlBox.Size = new System.Drawing.Size(220, 20);
this.urlBox.TabIndex = 1;
this.urlBox.Text = "";
this.urlBox.TextChanged += new System.EventHandler(this.urlBox_TextChanged);
//
// label1
//
this.label1.Location = new System.Drawing.Point(10, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 14);
this.label1.TabIndex = 0;
this.label1.Text = "&URL:";
//
// MJPEGSourcePage
//
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.passwordBox,
this.label3,
this.loginBox,
this.label2,
this.urlBox,
this.label1});
this.Name = "MJPEGSourcePage";
this.Size = new System.Drawing.Size(300, 150);
this.ResumeLayout(false);
}
#endregion
// Completed property
public bool Completed
{
get { return completed; }
}
// Show the page
public void Display()
{
urlBox.Focus();
urlBox.SelectionStart = urlBox.TextLength;
}
// Apply the page
public bool Apply()
{
return true;
}
// Get configuration object
public object GetConfiguration()
{
MJPEGConfiguration config = new MJPEGConfiguration();
config.source = urlBox.Text;
config.login = loginBox.Text;
config.password = passwordBox.Text;
return (object) config;
}
// Set configuration
public void SetConfiguration(object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
urlBox.Text = cfg.source;
loginBox.Text = cfg.login;
passwordBox.Text = cfg.password;
}
}
// URL changed
private void urlBox_TextChanged(object sender, System.EventArgs e)
{
completed = (urlBox.TextLength != 0);
if (StateChanged != null)
StateChanged(this, new EventArgs());
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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.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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.Name">
<value>MJPEGSourcePage</value>
</data>
</root>
\ No newline at end of file
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
using System.Xml;
using videosource;
/// <summary>
/// MJPEGSourceDescription
/// </summary>
public class MJPEGSourceDescription : IVideoSourceDescription
{
// Name property
public string Name
{
get { return "MJPEG stream"; }
}
// Description property
public string Description
{
get { return "Retrieve Motion JPEG stream from the specified URL"; }
}
// Return settings page
public IVideoSourcePage GetSettingsPage()
{
return new MJPEGSourcePage();
}
// Save configuration
public void SaveConfiguration(XmlTextWriter writer, object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
writer.WriteAttributeString("source", cfg.source);
writer.WriteAttributeString("login", cfg.login);
writer.WriteAttributeString("password", cfg.password);
}
}
// Load configuration
public object LoadConfiguration(XmlTextReader reader)
{
MJPEGConfiguration config = new MJPEGConfiguration();
try
{
config.source = reader.GetAttribute("source");
config.login = reader.GetAttribute("login");
config.password = reader.GetAttribute("password");
}
catch (Exception)
{
}
return (object) config;
}
// Create video source object
public IVideoSource CreateVideoSource(object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
MJPEGSource source = new MJPEGSource();
source.VideoSource = cfg.source;
source.Login = cfg.login;
source.Password = cfg.password;
return (IVideoSource) source;
}
return null;
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
/// <summary>
/// Some array utilities
/// </summary>
internal class ByteArrayUtils
{
// Check if the array contains needle on specified position
public static bool Compare(byte[] array, byte[] needle, int startIndex)
{
int needleLen = needle.Length;
// compare
for (int i = 0, p = startIndex; i < needleLen; i++, p++)
{
if (array[p] != needle[i])
{
return false;
}
}
return true;
}
// Find subarray in array
public static int Find(byte[] array, byte[] needle, int startIndex, int count)
{
int needleLen = needle.Length;
int index;
while (count >= needleLen)
{
index = Array.IndexOf(array, needle[0], startIndex, count - needleLen + 1);
if (index == -1)
return -1;
int i, p;
// check for needle
for (i = 0, p = index; i < needleLen; i++, p++)
{
if (array[p] != needle[i])
{
break;
}
}
if (i == needleLen)
{
// found needle
return index;
}
count -= (index - startIndex + 1);
startIndex = index + 1;
}
return -1;
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
/// <summary>
/// MJPEGConfiguration
/// </summary>
public class MJPEGConfiguration
{
public string source;
public string login;
public string password;
}
}
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Net;
using videosource;
/// <summary>
/// MJPEGSource - MJPEG stream support
/// </summary>
public class MJPEGSource : IVideoSource
{
private string source;
private string login = null;
private string password = null;
private object userData = null;
private int framesReceived;
private int bytesReceived;
private bool useSeparateConnectionGroup = true;
private const int bufSize = 512 * 1024; // buffer size
private const int readSize = 1024; // portion size to read
private Thread thread = null;
private ManualResetEvent stopEvent = null;
private ManualResetEvent reloadEvent = null;
// new frame event
public event CameraEventHandler NewFrame;
// SeparateConnectioGroup property
// indicates to open WebRequest in separate connection group
public bool SeparateConnectionGroup
{
get { return useSeparateConnectionGroup; }
set { useSeparateConnectionGroup = value; }
}
// VideoSource property
public string VideoSource
{
get { return source; }
set
{
source = value;
// signal to reload
if (thread != null)
reloadEvent.Set();
}
}
// Login property
public string Login
{
get { return login; }
set { login = value; }
}
// Password property
public string Password
{
get { return password; }
set { password = value; }
}
// FramesReceived property
public int FramesReceived
{
get
{
int frames = framesReceived;
framesReceived = 0;
return frames;
}
}
// BytesReceived property
public int BytesReceived
{
get
{
int bytes = bytesReceived;
bytesReceived = 0;
return bytes;
}
}
// UserData property
public object UserData
{
get { return userData; }
set { userData = value; }
}
// Get state of the video source thread
public bool Running
{
get
{
if (thread != null)
{
if (thread.Join(0) == false)
return true;
// the thread is not running, so free resources
Free();
}
return false;
}
}
// Constructor
public MJPEGSource()
{
}
// Start work
public void Start()
{
if (thread == null)
{
framesReceived = 0;
bytesReceived = 0;
// create events
stopEvent = new ManualResetEvent(false);
reloadEvent = new ManualResetEvent(false);
// create and start new thread
thread = new Thread(new ThreadStart(WorkerThread));
thread.Name = source;
thread.Start();
}
}
// Signal thread to stop work
public void SignalToStop()
{
// stop thread
if (thread != null)
{
// signal to stop
stopEvent.Set();
}
}
// Wait for thread stop
public void WaitForStop()
{
if (thread != null)
{
// wait for thread stop
thread.Join();
Free();
}
}
// Abort thread
public void Stop()
{
if (this.Running)
{
thread.Abort();
WaitForStop();
}
}
// Free resources
private void Free()
{
thread = null;
// release events
stopEvent.Close();
stopEvent = null;
reloadEvent.Close();
reloadEvent = null;
}
// Thread entry point
public void WorkerThread()
{
byte[] buffer = new byte[bufSize]; // buffer to read stream
while (true)
{
// reset reload event
reloadEvent.Reset();
HttpWebRequest req = null;
WebResponse resp = null;
Stream stream = null;
byte[] delimiter = null;
byte[] delimiter2 = null;
byte[] boundary = null;
int boundaryLen, delimiterLen = 0, delimiter2Len = 0;
int read, todo = 0, total = 0, pos = 0, align = 1;
int start = 0, stop = 0;
// align
// 1 = searching for image start
// 2 = searching for image end
try
{
// create request
req = (HttpWebRequest) WebRequest.Create(source);
// set login and password
if ((login != null) && (password != null) && (login != ""))
req.Credentials = new NetworkCredential(login, password);
// set connection group name
if (useSeparateConnectionGroup)
req.ConnectionGroupName = GetHashCode().ToString();
// get response
resp = req.GetResponse();
// check content type
string ct = resp.ContentType;
if (ct.IndexOf("multipart/x-mixed-replace") == -1)
throw new ApplicationException("Invalid URL");
// get boundary
ASCIIEncoding encoding = new ASCIIEncoding();
boundary = encoding.GetBytes(ct.Substring(ct.IndexOf("boundary=", 0) + 9));
boundaryLen = boundary.Length;
// get response stream
stream = resp.GetResponseStream();
// loop
while ((!stopEvent.WaitOne(0, true)) && (!reloadEvent.WaitOne(0, true)))
{
// check total read
if (total > bufSize - readSize)
{
total = pos = todo = 0;
}
// read next portion from stream
if ((read = stream.Read(buffer, total, readSize)) == 0)
throw new ApplicationException();
total += read;
todo += read;
// increment received bytes counter
bytesReceived += read;
// does we know the delimiter ?
if (delimiter == null)
{
// find boundary
pos = ByteArrayUtils.Find(buffer, boundary, pos, todo);
if (pos == -1)
{
// was not found
todo = boundaryLen - 1;
pos = total - todo;
continue;
}
todo = total - pos;
if (todo < 2)
continue;
// check new line delimiter type
if (buffer[pos + boundaryLen] == 10)
{
delimiterLen = 2;
delimiter = new byte[2] {10, 10};
delimiter2Len = 1;
delimiter2 = new byte[1] {10};
}
else
{
delimiterLen = 4;
delimiter = new byte[4] {13, 10, 13, 10};
delimiter2Len = 2;
delimiter2 = new byte[2] {13, 10};
}
pos += boundaryLen + delimiter2Len;
todo = total - pos;
}
// search for image
if (align == 1)
{
start = ByteArrayUtils.Find(buffer, delimiter, pos, todo);
if (start != -1)
{
// found delimiter
start += delimiterLen;
pos = start;
todo = total - pos;
align = 2;
}
else
{
// delimiter not found
todo = delimiterLen - 1;
pos = total - todo;
}
}
// search for image end
while ((align == 2) && (todo >= boundaryLen))
{
stop = ByteArrayUtils.Find(buffer, boundary, pos, todo);
if (stop != -1)
{
pos = stop;
todo = total - pos;
// increment frames counter
framesReceived ++;
// image at stop
if (NewFrame != null)
{
Bitmap bmp = (Bitmap) Bitmap.FromStream(new MemoryStream(buffer, start, stop - start));
// notify client
NewFrame(this, new CameraEventArgs(bmp));
// release the image
bmp.Dispose();
bmp = null;
}
// shift array
pos = stop + boundaryLen;
todo = total - pos;
Array.Copy(buffer, pos, buffer, 0, todo);
total = todo;
pos = 0;
align = 1;
}
else
{
// delimiter not found
todo = boundaryLen - 1;
pos = total - todo;
}
}
}
}
catch (WebException ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
// wait for a while before the next try
Thread.Sleep(250);
}
catch (ApplicationException ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
// wait for a while before the next try
Thread.Sleep(250);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
}
finally
{
// abort request
if (req != null)
{
req.Abort();
req = null;
}
// close response stream
if (stream != null)
{
stream.Close();
stream = null;
}
// close response
if (resp != null)
{
resp.Close();
resp = null;
}
}
// need to stop ?
if (stopEvent.WaitOne(0, true))
break;
}
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using videosource;
namespace mjpeg
{
/// <summary>
/// Summary description for MJPEGSourcePage.
/// </summary>
public class MJPEGSourcePage : System.Windows.Forms.UserControl, IVideoSourcePage
{
private bool completed = false;
private System.Windows.Forms.TextBox passwordBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox loginBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox urlBox;
private System.Windows.Forms.Label label1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
// new frame event
public event EventHandler StateChanged;
// Constructor
public MJPEGSourcePage()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitForm call
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(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.passwordBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.loginBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.urlBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// passwordBox
//
this.passwordBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.passwordBox.Location = new System.Drawing.Point(70, 70);
this.passwordBox.Name = "passwordBox";
this.passwordBox.Size = new System.Drawing.Size(220, 20);
this.passwordBox.TabIndex = 5;
this.passwordBox.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(10, 73);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(60, 14);
this.label3.TabIndex = 4;
this.label3.Text = "&Password:";
//
// loginBox
//
this.loginBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.loginBox.Location = new System.Drawing.Point(70, 40);
this.loginBox.Name = "loginBox";
this.loginBox.Size = new System.Drawing.Size(220, 20);
this.loginBox.TabIndex = 3;
this.loginBox.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(10, 43);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 14);
this.label2.TabIndex = 2;
this.label2.Text = "&Login:";
//
// urlBox
//
this.urlBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.urlBox.Location = new System.Drawing.Point(70, 10);
this.urlBox.Name = "urlBox";
this.urlBox.Size = new System.Drawing.Size(220, 20);
this.urlBox.TabIndex = 1;
this.urlBox.Text = "";
this.urlBox.TextChanged += new System.EventHandler(this.urlBox_TextChanged);
//
// label1
//
this.label1.Location = new System.Drawing.Point(10, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 14);
this.label1.TabIndex = 0;
this.label1.Text = "&URL:";
//
// MJPEGSourcePage
//
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.passwordBox,
this.label3,
this.loginBox,
this.label2,
this.urlBox,
this.label1});
this.Name = "MJPEGSourcePage";
this.Size = new System.Drawing.Size(300, 150);
this.ResumeLayout(false);
}
#endregion
// Completed property
public bool Completed
{
get { return completed; }
}
// Show the page
public void Display()
{
urlBox.Focus();
urlBox.SelectionStart = urlBox.TextLength;
}
// Apply the page
public bool Apply()
{
return true;
}
// Get configuration object
public object GetConfiguration()
{
MJPEGConfiguration config = new MJPEGConfiguration();
config.source = urlBox.Text;
config.login = loginBox.Text;
config.password = passwordBox.Text;
return (object) config;
}
// Set configuration
public void SetConfiguration(object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
urlBox.Text = cfg.source;
loginBox.Text = cfg.login;
passwordBox.Text = cfg.password;
}
}
// URL changed
private void urlBox_TextChanged(object sender, System.EventArgs e)
{
completed = (urlBox.TextLength != 0);
if (StateChanged != null)
StateChanged(this, new EventArgs());
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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.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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.Name">
<value>MJPEGSourcePage</value>
</data>
</root>
\ No newline at end of file
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
using System.Xml;
using videosource;
/// <summary>
/// MJPEGSourceDescription
/// </summary>
public class MJPEGSourceDescription : IVideoSourceDescription
{
// Name property
public string Name
{
get { return "MJPEG stream"; }
}
// Description property
public string Description
{
get { return "Retrieve Motion JPEG stream from the specified URL"; }
}
// Return settings page
public IVideoSourcePage GetSettingsPage()
{
return new MJPEGSourcePage();
}
// Save configuration
public void SaveConfiguration(XmlTextWriter writer, object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
writer.WriteAttributeString("source", cfg.source);
writer.WriteAttributeString("login", cfg.login);
writer.WriteAttributeString("password", cfg.password);
}
}
// Load configuration
public object LoadConfiguration(XmlTextReader reader)
{
MJPEGConfiguration config = new MJPEGConfiguration();
try
{
config.source = reader.GetAttribute("source");
config.login = reader.GetAttribute("login");
config.password = reader.GetAttribute("password");
}
catch (Exception)
{
}
return (object) config;
}
// Create video source object
public IVideoSource CreateVideoSource(object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
MJPEGSource source = new MJPEGSource();
source.VideoSource = cfg.source;
source.Login = cfg.login;
source.Password = cfg.password;
return (IVideoSource) source;
}
return null;
}
}
}
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.exe.config
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.exe
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\ConfLib2.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\DynamicPg.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Mono.Security.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Mono.Security.Protocol.Tls.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Npgsql.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\NpgsqlAltPool.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\AutoUpdateLib.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\DynamicPg.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\DynamicPg.xml
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Npgsql.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Npgsql.xml
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\NpgsqlAltPool.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\NpgsqlAltPool.xml
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.Form1.resources
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\mjpeg.MJPEGSourcePage.resources
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.Properties.Resources.resources
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
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\obj\Release\ResolveAssemblyReference.cache
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\obj\Release\RamaSignup.Form1.resources
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\obj\Release\mjpeg.MJPEGSourcePage.resources
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\obj\Release\RamaSignup.Properties.Resources.resources
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\obj\Release\RamaSignup.csproj.GenerateResource.Cache
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\RamaSignup.exe.config
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\RamaSignup.exe
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\RamaSignup.pdb
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\AutoUpdateLib.dll
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\ConfLib2.dll
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\DynamicPg.dll
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Mono.Security.dll
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Mono.Security.Protocol.Tls.dll
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Npgsql.dll
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\NpgsqlAltPool.dll
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\AutoUpdateLib.pdb
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\NpgsqlAltPool.pdb
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\NpgsqlAltPool.xml
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\DynamicPg.pdb
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\DynamicPg.xml
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Npgsql.pdb
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Npgsql.xml
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\obj\Release\RamaSignup.exe
C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\obj\Release\RamaSignup.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.exe.config
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\MoyaSignup\obj\Release\RamaSignup.csprojResolveAssemblyReference.cache
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.Form1.resources
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\mjpeg.MJPEGSourcePage.resources
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.Properties.Resources.resources
D:\Devel\proj\moya-info-tools\MoyaSignup\obj\Release\RamaSignup.csproj.GenerateResource.Cache
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.exe
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\RamaSignup.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\ConfLib2.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\DynamicPg.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Mono.Security.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Mono.Security.Protocol.Tls.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Npgsql.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\NpgsqlAltPool.dll
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\AutoUpdateLib.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\DynamicPg.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\DynamicPg.xml
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Npgsql.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\Npgsql.xml
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\NpgsqlAltPool.pdb
D:\Devel\proj\moya-info-tools\MoyaSignup\bin\Debug\NpgsqlAltPool.xml
; NSIS script - ONLY for use with AutoPublish/AutoUpdate system
; //keitsi
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;Configuration
SetCompressor lzma
Name "RamaSignup v1_00_05 vectorama"
; DO NOT CHANGE OutFile "installer_temp.exe" !!! AutoPublish requires this.
; AutoPublish will move the installer according to autopublish.xml file.
OutFile "installer_temp.exe"
;Folder selection page
InstallDir "$PROGRAMFILES\RamaSignup"
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\RamaSignup" ""
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
; !insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
; !define MUI_FINISHPAGE_RUN $INSTDIR\RamaSignup.exe
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Function GetDotNet
IfFileExists "$WINDIR\Microsoft.NET\Framework\v2.0.50727\installUtil.exe" NextStep
MessageBox MB_OK|MB_ICONEXCLAMATION "You must have the Microsoft .NET Framework 2.0 Installed to use this application. $\n$\nClick 'Open' in the following file dialog to download and run the Microsoft .NET Framework Installer..."
ExecShell Open "http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=0856eacb-4362-4b0d-8edd-aab15c5e04f5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f5%2f6%2f7%2f567758a3-759e-473e-bf8f-52154438565a%2fdotnetfx.exe" SW_SHOWNORMAL
Quit
NextStep:
FunctionEnd
Function .onInit
Call GetDotNet
FunctionEnd
Function .onInstSuccess
Exec '"$INSTDIR\RamaSignup.exe"'
FunctionEnd
Function WaitProgramClose
IfFileExists "$INSTDIR\RamaSignup.exe" loop NotInstalled
loop:
ClearErrors
Delete "$INSTDIR\RamaSignup.exe"
${If} ${Errors}
; Delete failed - means the program is still running. Sleep 2 seconds and retry.
Sleep 2000
ClearErrors
Delete "$INSTDIR\RamaSignup.exe"
${If} ${Errors}
MessageBox MB_OK "Program RamaSignup.exe didn't close in 2 seconds. Automatic update can't continue before it's closed. Please close the program manually and hit OK to retry."
goto loop
${EndIf}
${EndIf}
NotInstalled:
FunctionEnd
Section "!RamaSignup v1_00_05" SecMain
SetOutPath "$INSTDIR"
Call WaitProgramClose
SetOverwrite off
File /oname=ramasignup.conf "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\ramasignup.conf"
SetOverwrite on
File /oname=autoupdate.xml "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\autoupdate.vectorama.xml"
File /oname=RamaSignup.exe "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\RamaSignup.exe"
File /oname=RamaSignup.pdb "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\RamaSignup.pdb"
; File /oname=Npgsql.pdb "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Npgsql.pdb"
; File /oname=NpgsqlAltPool.pdb "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\NpgsqlAltPool.pdb"
File /oname=AutoUpdateLib.pdb "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\AutoUpdateLib.pdb"
; File /oname=ConfLibSql.pdb "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\ConfLibSql.pdb"
File autoupdate.crt
;File "..\..\res\speexenc.exe"
; File "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\logo.jpg"
; this line will be replicated for every non-default existing assembly
; that is referenced to the main project.
File "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\ConfLib2.dll"
File "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\NpgsqlAltPool.dll"
File "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Npgsql.dll"
File "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Mono.Security.dll"
File "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\AutoUpdateLib.dll"
File "C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\DynamicPg.dll"
WriteRegStr HKCU "Software\RamaSignup" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
;Create shortcuts
CreateDirectory "$SMPROGRAMS\RamaSignup"
CreateShortCut "$SMPROGRAMS\RamaSignup\RamaSignup.lnk" "$INSTDIR\RamaSignup.exe"
CreateShortCut "$SMPROGRAMS\RamaSignup\Uninstall RamaSignup.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Descriptions
LangString DESC_SecMain ${LANG_ENGLISH} "Base (required)"
;--------------------------------
;Uninstaller Section
Section "Uninstall"
Delete "$SMPROGRAMS\RamaSignup\*"
RMDir "$SMPROGRAMS\RamaSignup"
Delete "$INSTDIR\RamaSignup.exe"
Delete "$INSTDIR\autoupdate.xml"
Delete "$INSTDIR\autoupdate.crt"
Delete "$INSTDIR\speexenc.exe"
; this line will be replicated for every non-default existing assembly
; that is referenced to the main project.
Delete "$INSTDIR\C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\ConfLib2.dll"
Delete "$INSTDIR\C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\NpgsqlAltPool.dll"
Delete "$INSTDIR\C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Npgsql.dll"
Delete "$INSTDIR\C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\Mono.Security.dll"
Delete "$INSTDIR\C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\AutoUpdateLib.dll"
Delete "$INSTDIR\C:\Devel\proj\BigBrother\RamaSignup\RamaSignup\bin\Debug\DynamicPg.dll"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
SectionEnd
K 25
svn:wc:ra_dav:version-url
V 45
/RamaSignup/!svn/ver/8/RamaSignup/videosource
END
IVideoSourcePage.cs
K 25
svn:wc:ra_dav:version-url
V 65
/RamaSignup/!svn/ver/8/RamaSignup/videosource/IVideoSourcePage.cs
END
IVideoSource.cs
K 25
svn:wc:ra_dav:version-url
V 61
/RamaSignup/!svn/ver/8/RamaSignup/videosource/IVideoSource.cs
END
Events.cs
K 25
svn:wc:ra_dav:version-url
V 55
/RamaSignup/!svn/ver/8/RamaSignup/videosource/Events.cs
END
IVideoSourceDescription.cs
K 25
svn:wc:ra_dav:version-url
V 72
/RamaSignup/!svn/ver/8/RamaSignup/videosource/IVideoSourceDescription.cs
END
Core.cs
K 25
svn:wc:ra_dav:version-url
V 53
/RamaSignup/!svn/ver/8/RamaSignup/videosource/Core.cs
END
8
dir
8
https://svn.f-solutions.fi/RamaSignup/RamaSignup/videosource
https://svn.f-solutions.fi/RamaSignup
2010-02-19T12:46:56.698865Z
8
tapsa
svn:special svn:externals svn:needs-lock
IVideoSourcePage.cs
file
2006-10-09T19:25:40.000000Z
85f885918db88c11c4ae6b1cdf2d6244
2010-02-19T12:46:56.698865Z
8
tapsa
IVideoSource.cs
file
2006-10-09T19:25:42.000000Z
91f8bf09662313012d28095cad5f75cd
2010-02-19T12:46:56.698865Z
8
tapsa
Events.cs
file
2006-10-09T19:25:44.000000Z
24791bdb0ac8c32906d6bdeba43be7cd
2010-02-19T12:46:56.698865Z
8
tapsa
IVideoSourceDescription.cs
file
2006-10-09T19:25:42.000000Z
bab64e797d2f99a19c66ea6993071c86
2010-02-19T12:46:56.698865Z
8
tapsa
Core.cs
file
2006-10-09T19:25:44.000000Z
a957fe65b6fa377e327d5b9eaa39be53
2010-02-19T12:46:56.698865Z
8
tapsa
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
// stream types
public enum StreamType
{
Jpeg,
MJpeg
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
using System.Drawing.Imaging;
// NewFrame delegate
public delegate void CameraEventHandler(object sender, CameraEventArgs e);
/// <summary>
/// Camera event arguments
/// </summary>
public class CameraEventArgs : EventArgs
{
private System.Drawing.Bitmap bmp;
// Constructor
public CameraEventArgs(System.Drawing.Bitmap bmp)
{
this.bmp = bmp;
}
// Bitmap property
public System.Drawing.Bitmap Bitmap
{
get { return bmp; }
}
}
}
\ No newline at end of file
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
/// <summary>
/// IVideoSource interface
/// </summary>
public interface IVideoSource
{
/// <summary>
/// New frame event - notify client about the new frame
/// </summary>
event CameraEventHandler NewFrame;
/// <summary>
/// Video source property
/// </summary>
string VideoSource{get; set;}
/// <summary>
/// Login property
/// </summary>
string Login{get; set;}
/// <summary>
/// Password property
/// </summary>
string Password{get; set;}
/// <summary>
/// FramesReceived property
/// get number of frames the video source received from the last
/// access to the property
/// </summary>
int FramesReceived{get;}
/// <summary>
/// BytesReceived property
/// get number of bytes the video source received from the last
/// access to the property
/// </summary>
int BytesReceived{get;}
/// <summary>
/// UserData property
/// allows to associate user data with an object
/// </summary>
object UserData{get; set;}
/// <summary>
/// Get state of video source
/// </summary>
bool Running{get;}
/// <summary>
/// Start receiving video frames
/// </summary>
void Start();
/// <summary>
/// Stop receiving video frames
/// </summary>
void SignalToStop();
/// <summary>
/// Wait for stop
/// </summary>
void WaitForStop();
/// <summary>
/// Stop work
/// </summary>
void Stop();
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
using System.Xml;
/// <summary>
/// IVideoSourceDescription interface - description of video source
/// </summary>
public interface IVideoSourceDescription
{
/// <summary>
/// Name property
/// </summary>
string Name{get;}
/// <summary>
/// Description property
/// </summary>
string Description{get;}
/// <summary>
/// Return settings page
/// </summary>
IVideoSourcePage GetSettingsPage();
/// <summary>
/// Save configuration
/// </summary>
void SaveConfiguration(XmlTextWriter writer, object config);
/// <summary>
/// Load configuration
/// </summary>
object LoadConfiguration(XmlTextReader reader);
/// <summary>
/// Create video source object
/// </summary>
IVideoSource CreateVideoSource(object config);
}
}
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
/// <summary>
/// IVideoSourcePage interface
/// </summary>
public interface IVideoSourcePage
{
/// <summary>
/// State changed event - notify client if the page is completed
/// </summary>
event EventHandler StateChanged;
/// <summary>
/// Completed property
/// true, if the page is completed and wizard can proceed to next page
/// </summary>
bool Completed { get; }
/// <summary>
/// Display - display the page
/// Wizard call the method after the page was shown
/// </summary>
void Display();
/// <summary>
/// Apply - check and update all variables
/// Return false if something wrong and we want to stay on the page
/// </summary>
bool Apply();
/// <summary>
/// Get configuration object
/// </summary>
object GetConfiguration();
/// <summary>
/// Set configuration
/// </summary>
void SetConfiguration(object config);
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
// stream types
public enum StreamType
{
Jpeg,
MJpeg
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
using System.Drawing.Imaging;
// NewFrame delegate
public delegate void CameraEventHandler(object sender, CameraEventArgs e);
/// <summary>
/// Camera event arguments
/// </summary>
public class CameraEventArgs : EventArgs
{
private System.Drawing.Bitmap bmp;
// Constructor
public CameraEventArgs(System.Drawing.Bitmap bmp)
{
this.bmp = bmp;
}
// Bitmap property
public System.Drawing.Bitmap Bitmap
{
get { return bmp; }
}
}
}
\ No newline at end of file
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
/// <summary>
/// IVideoSource interface
/// </summary>
public interface IVideoSource
{
/// <summary>
/// New frame event - notify client about the new frame
/// </summary>
event CameraEventHandler NewFrame;
/// <summary>
/// Video source property
/// </summary>
string VideoSource{get; set;}
/// <summary>
/// Login property
/// </summary>
string Login{get; set;}
/// <summary>
/// Password property
/// </summary>
string Password{get; set;}
/// <summary>
/// FramesReceived property
/// get number of frames the video source received from the last
/// access to the property
/// </summary>
int FramesReceived{get;}
/// <summary>
/// BytesReceived property
/// get number of bytes the video source received from the last
/// access to the property
/// </summary>
int BytesReceived{get;}
/// <summary>
/// UserData property
/// allows to associate user data with an object
/// </summary>
object UserData{get; set;}
/// <summary>
/// Get state of video source
/// </summary>
bool Running{get;}
/// <summary>
/// Start receiving video frames
/// </summary>
void Start();
/// <summary>
/// Stop receiving video frames
/// </summary>
void SignalToStop();
/// <summary>
/// Wait for stop
/// </summary>
void WaitForStop();
/// <summary>
/// Stop work
/// </summary>
void Stop();
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
using System.Xml;
/// <summary>
/// IVideoSourceDescription interface - description of video source
/// </summary>
public interface IVideoSourceDescription
{
/// <summary>
/// Name property
/// </summary>
string Name{get;}
/// <summary>
/// Description property
/// </summary>
string Description{get;}
/// <summary>
/// Return settings page
/// </summary>
IVideoSourcePage GetSettingsPage();
/// <summary>
/// Save configuration
/// </summary>
void SaveConfiguration(XmlTextWriter writer, object config);
/// <summary>
/// Load configuration
/// </summary>
object LoadConfiguration(XmlTextReader reader);
/// <summary>
/// Create video source object
/// </summary>
IVideoSource CreateVideoSource(object config);
}
}
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace videosource
{
using System;
/// <summary>
/// IVideoSourcePage interface
/// </summary>
public interface IVideoSourcePage
{
/// <summary>
/// State changed event - notify client if the page is completed
/// </summary>
event EventHandler StateChanged;
/// <summary>
/// Completed property
/// true, if the page is completed and wizard can proceed to next page
/// </summary>
bool Completed { get; }
/// <summary>
/// Display - display the page
/// Wizard call the method after the page was shown
/// </summary>
void Display();
/// <summary>
/// Apply - check and update all variables
/// Return false if something wrong and we want to stay on the page
/// </summary>
bool Apply();
/// <summary>
/// Get configuration object
/// </summary>
object GetConfiguration();
/// <summary>
/// Set configuration
/// </summary>
void SetConfiguration(object config);
}
}
//*****************************************************************************************
// 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!