Commit 9595c474 by Tapio Haapala

palautus gittipaskan sössimistä jutuista

1 parent 84ed809c
Showing with 7341 additions and 0 deletions
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;
}
}
}
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.label10 = new System.Windows.Forms.Label();
this.cmbGender = new System.Windows.Forms.ComboBox();
this.txtPhone = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.txtCity = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtAge = new System.Windows.Forms.TextBox();
this.txtZip = new System.Windows.Forms.TextBox();
this.txtAdress = new System.Windows.Forms.TextBox();
this.txtEmail = new System.Windows.Forms.TextBox();
this.txtNick = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.btnClear = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnTakePic = new System.Windows.Forms.Button();
this.pbIncoming = new System.Windows.Forms.PictureBox();
this.btnFinnish = new System.Windows.Forms.Button();
this.btnEnglish = new System.Windows.Forms.Button();
this.lblMessage = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).BeginInit();
this.SuspendLayout();
//
// label10
//
this.label10.AutoSize = true;
this.label10.BackColor = System.Drawing.Color.Transparent;
this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label10.Location = new System.Drawing.Point(277, 87);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(60, 16);
this.label10.TabIndex = 73;
this.label10.Text = "Gender";
//
// cmbGender
//
this.cmbGender.BackColor = System.Drawing.SystemColors.Window;
this.cmbGender.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbGender.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cmbGender.FormattingEnabled = true;
this.cmbGender.Items.AddRange(new object[] {
"I don\'t know",
"Male",
"Female"});
this.cmbGender.Location = new System.Drawing.Point(280, 105);
this.cmbGender.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.cmbGender.Name = "cmbGender";
this.cmbGender.Size = new System.Drawing.Size(125, 28);
this.cmbGender.TabIndex = 4;
this.cmbGender.SelectedIndexChanged += new System.EventHandler(this.cmbGender_SelectedIndexChanged);
//
// txtPhone
//
this.txtPhone.BackColor = System.Drawing.SystemColors.Window;
this.txtPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtPhone.Location = new System.Drawing.Point(411, 106);
this.txtPhone.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtPhone.Name = "txtPhone";
this.txtPhone.Size = new System.Drawing.Size(138, 26);
this.txtPhone.TabIndex = 5;
this.txtPhone.TextChanged += new System.EventHandler(this.txtPhone_TextChanged);
//
// label9
//
this.label9.AutoSize = true;
this.label9.BackColor = System.Drawing.Color.Transparent;
this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label9.Location = new System.Drawing.Point(408, 87);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(53, 16);
this.label9.TabIndex = 71;
this.label9.Text = "Phone";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtCity
//
this.txtCity.BackColor = System.Drawing.SystemColors.Window;
this.txtCity.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtCity.Location = new System.Drawing.Point(280, 271);
this.txtCity.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtCity.Name = "txtCity";
this.txtCity.Size = new System.Drawing.Size(125, 26);
this.txtCity.TabIndex = 9;
this.txtCity.TextChanged += new System.EventHandler(this.txtCity_TextChanged);
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label8.Location = new System.Drawing.Point(277, 252);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(36, 16);
this.label8.TabIndex = 70;
this.label8.Text = "City";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label7
//
this.label7.AutoSize = true;
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(143, 87);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(95, 16);
this.label7.TabIndex = 69;
this.label7.Text = "Date of birth";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label6.Location = new System.Drawing.Point(143, 252);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(31, 16);
this.label6.TabIndex = 68;
this.label6.Text = "Zip";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(143, 197);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(112, 16);
this.label5.TabIndex = 67;
this.label5.Text = "Street address";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label4
//
this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.Location = new System.Drawing.Point(143, 142);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(55, 16);
this.label4.TabIndex = 66;
this.label4.Text = "E-Mail";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtAge
//
this.txtAge.BackColor = System.Drawing.SystemColors.Window;
this.txtAge.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtAge.Location = new System.Drawing.Point(146, 106);
this.txtAge.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtAge.Name = "txtAge";
this.txtAge.Size = new System.Drawing.Size(128, 26);
this.txtAge.TabIndex = 3;
this.txtAge.TextChanged += new System.EventHandler(this.txtAge_TextChanged);
//
// txtZip
//
this.txtZip.BackColor = System.Drawing.SystemColors.Window;
this.txtZip.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtZip.Location = new System.Drawing.Point(146, 271);
this.txtZip.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtZip.Name = "txtZip";
this.txtZip.Size = new System.Drawing.Size(128, 26);
this.txtZip.TabIndex = 8;
this.txtZip.TextChanged += new System.EventHandler(this.txtZip_TextChanged);
//
// txtAdress
//
this.txtAdress.BackColor = System.Drawing.SystemColors.Window;
this.txtAdress.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtAdress.Location = new System.Drawing.Point(146, 216);
this.txtAdress.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtAdress.Name = "txtAdress";
this.txtAdress.Size = new System.Drawing.Size(403, 26);
this.txtAdress.TabIndex = 7;
this.txtAdress.TextChanged += new System.EventHandler(this.txtAdress_TextChanged);
//
// txtEmail
//
this.txtEmail.BackColor = System.Drawing.SystemColors.Window;
this.txtEmail.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtEmail.Location = new System.Drawing.Point(146, 161);
this.txtEmail.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtEmail.Name = "txtEmail";
this.txtEmail.Size = new System.Drawing.Size(403, 26);
this.txtEmail.TabIndex = 6;
this.txtEmail.TextChanged += new System.EventHandler(this.txtEmail_TextChanged);
//
// txtNick
//
this.txtNick.BackColor = System.Drawing.SystemColors.Window;
this.txtNick.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtNick.Location = new System.Drawing.Point(146, 51);
this.txtNick.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtNick.MaxLength = 12;
this.txtNick.Name = "txtNick";
this.txtNick.Size = new System.Drawing.Size(128, 26);
this.txtNick.TabIndex = 2;
this.txtNick.TextChanged += new System.EventHandler(this.txtNick_TextChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(143, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(40, 16);
this.label2.TabIndex = 59;
this.label2.Text = "Nick";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(277, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(82, 16);
this.label1.TabIndex = 56;
this.label1.Text = "First name";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtName
//
this.txtName.BackColor = System.Drawing.SystemColors.Window;
this.txtName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtName.Location = new System.Drawing.Point(280, 51);
this.txtName.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(125, 26);
this.txtName.TabIndex = 1;
this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged);
//
// btnClear
//
this.btnClear.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnClear.Location = new System.Drawing.Point(841, 258);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(181, 35);
this.btnClear.TabIndex = 74;
this.btnClear.Text = "Clear";
this.btnClear.UseVisualStyleBackColor = true;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// btnSave
//
this.btnSave.Enabled = false;
this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold);
this.btnSave.Location = new System.Drawing.Point(841, 299);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(181, 36);
this.btnSave.TabIndex = 11;
this.btnSave.Text = "Save";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnTakePic
//
this.btnTakePic.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnTakePic.Location = new System.Drawing.Point(841, 216);
this.btnTakePic.Name = "btnTakePic";
this.btnTakePic.Size = new System.Drawing.Size(181, 36);
this.btnTakePic.TabIndex = 0;
this.btnTakePic.Text = "Use this picture";
this.btnTakePic.UseVisualStyleBackColor = true;
this.btnTakePic.Click += new System.EventHandler(this.btnTakePic_Click);
//
// pbIncoming
//
this.pbIncoming.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbIncoming.Location = new System.Drawing.Point(555, 12);
this.pbIncoming.Name = "pbIncoming";
this.pbIncoming.Size = new System.Drawing.Size(280, 410);
this.pbIncoming.TabIndex = 78;
this.pbIncoming.TabStop = false;
//
// btnFinnish
//
this.btnFinnish.Image = ((System.Drawing.Image)(resources.GetObject("btnFinnish.Image")));
this.btnFinnish.Location = new System.Drawing.Point(854, 73);
this.btnFinnish.Name = "btnFinnish";
this.btnFinnish.Size = new System.Drawing.Size(128, 63);
this.btnFinnish.TabIndex = 80;
this.btnFinnish.UseVisualStyleBackColor = true;
this.btnFinnish.Click += new System.EventHandler(this.btnFinnish_Click);
//
// btnEnglish
//
this.btnEnglish.Image = ((System.Drawing.Image)(resources.GetObject("btnEnglish.Image")));
this.btnEnglish.Location = new System.Drawing.Point(854, 142);
this.btnEnglish.Name = "btnEnglish";
this.btnEnglish.Size = new System.Drawing.Size(128, 65);
this.btnEnglish.TabIndex = 81;
this.btnEnglish.UseVisualStyleBackColor = true;
this.btnEnglish.Click += new System.EventHandler(this.btnEnglish_Click);
//
// lblMessage
//
this.lblMessage.BackColor = System.Drawing.Color.Transparent;
this.lblMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMessage.Location = new System.Drawing.Point(26, 431);
this.lblMessage.Name = "lblMessage";
this.lblMessage.Size = new System.Drawing.Size(969, 73);
this.lblMessage.TabIndex = 84;
this.lblMessage.Text = "label3";
this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblMessage.Click += new System.EventHandler(this.lbMessage_Click);
//
// 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;
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.SystemColors.Window;
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox1.Location = new System.Drawing.Point(414, 51);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(135, 26);
this.textBox1.TabIndex = 87;
//
// label11
//
this.label11.AutoSize = true;
this.label11.BackColor = System.Drawing.Color.Transparent;
this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label11.Location = new System.Drawing.Point(411, 32);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(81, 16);
this.label11.TabIndex = 88;
this.label11.Text = "Last name";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox2
//
this.textBox2.BackColor = System.Drawing.SystemColors.Window;
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox2.Location = new System.Drawing.Point(146, 333);
this.textBox2.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(128, 26);
this.textBox2.TabIndex = 89;
//
// label12
//
this.label12.AutoSize = true;
this.label12.BackColor = System.Drawing.Color.Transparent;
this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label12.Location = new System.Drawing.Point(143, 307);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(80, 16);
this.label12.TabIndex = 90;
this.label12.Text = "Username";
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label13
//
this.label13.AutoSize = true;
this.label13.BackColor = System.Drawing.Color.Transparent;
this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label13.Location = new System.Drawing.Point(277, 307);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(77, 16);
this.label13.TabIndex = 91;
this.label13.Text = "Password";
this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label13.Click += new System.EventHandler(this.label13_Click);
//
// textBox3
//
this.textBox3.BackColor = System.Drawing.SystemColors.Window;
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox3.Location = new System.Drawing.Point(280, 333);
this.textBox3.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(125, 26);
this.textBox3.TabIndex = 92;
//
// textBox4
//
this.textBox4.BackColor = System.Drawing.SystemColors.Window;
this.textBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox4.Location = new System.Drawing.Point(411, 333);
this.textBox4.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(138, 26);
this.textBox4.TabIndex = 93;
//
// label14
//
this.label14.AutoSize = true;
this.label14.BackColor = System.Drawing.Color.Transparent;
this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.label14.Location = new System.Drawing.Point(408, 307);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(121, 16);
this.label14.TabIndex = 94;
this.label14.Text = "Password again";
this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(1012, 758);
this.button1.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);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::RamaSignup.Properties.Resources.vecto_tausta;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1024, 768);
this.Controls.Add(this.button1);
this.Controls.Add(this.label14);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.label13);
this.Controls.Add(this.label12);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label11);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.lblMessage);
this.Controls.Add(this.btnEnglish);
this.Controls.Add(this.btnFinnish);
this.Controls.Add(this.pbIncoming);
this.Controls.Add(this.btnTakePic);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.btnClear);
this.Controls.Add(this.label10);
this.Controls.Add(this.cmbGender);
this.Controls.Add(this.txtPhone);
this.Controls.Add(this.label9);
this.Controls.Add(this.txtCity);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.txtAge);
this.Controls.Add(this.txtZip);
this.Controls.Add(this.txtAdress);
this.Controls.Add(this.txtEmail);
this.Controls.Add(this.txtNick);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtName);
this.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);
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label10;
private System.Windows.Forms.ComboBox cmbGender;
private System.Windows.Forms.TextBox txtPhone;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtCity;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtAge;
private System.Windows.Forms.TextBox txtZip;
private System.Windows.Forms.TextBox txtAdress;
private System.Windows.Forms.TextBox txtEmail;
private System.Windows.Forms.TextBox txtNick;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnTakePic;
private System.Windows.Forms.PictureBox pbIncoming;
private System.Windows.Forms.Button btnFinnish;
private System.Windows.Forms.Button btnEnglish;
private System.Windows.Forms.Label lblMessage;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Button button1;
}
}
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;
namespace RamaSignup
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
enum Language
{
Finnish = 0,
English = 1,
}
Language currentLanguage = Language.English;
Image img;
Pen RetanglePen = new Pen(Color.Blue);
int RetangleHeight = 410;
int RetangleWidth = 280;
void changed()
{
if (!pictureTaken && wc != null)
{
if (currentLanguage == Language.English)
{
this.lblMessage.Text = "Take a picture first by pressing 'Use this picture' button";
}
else
{
this.lblMessage.Text = "Ota kuva ensin painamalla 'Käytä tätä kuvaa' nappia";
}
this.lblMessage.ForeColor = Color.Red;
this.btnSave.Enabled = false;
return;
}
string errorType = checkFields();
if (errorType != null)
{
if (currentLanguage == Language.English)
{
this.lblMessage.Text = errorType + " is missing or invalid. Fill the required fields with correct information.";
}
else
{
this.lblMessage.Text = errorType + " puuttuu tai on virheellinen. Täytä puuttuvat kentät oikeilla tiedoilla.";
}
this.lblMessage.ForeColor = Color.Red;
this.btnSave.Enabled = false;
return;
}
this.lblMessage.ForeColor = Color.Green;
if (currentLanguage == Language.English)
{
this.lblMessage.Text = "OK, verify information and click save";
}
else
{
this.lblMessage.Text = "OK, varmista tietojen oikeellisuus ja tallenna";
}
this.btnSave.Enabled = true;
}
string checkFields()
{
int tmp;
//checking validity
if (this.txtName.Text.Trim().Length < 5)
{
if (currentLanguage == Language.English)
return "Name";
else
return "Nimi";
}
else if (this.txtNick.Text.Trim().Length < 2)
{
if (currentLanguage == Language.English)
return "Nick";
else
return "Nick (nimimerkki)";
}
else if (this.txtAge.Text.Trim().Length < 1 || (!int.TryParse(this.txtAge.Text.Trim(), out tmp)))
{
if (currentLanguage == Language.English)
return "Age";
else
return "Ikä";
}
else if (this.cmbGender.SelectedIndex == 0)
{
if (currentLanguage == Language.English)
return "Gender";
else
return "Sukupuoli";
}
else if (this.txtPhone.Text.Length < 2)
{
if (currentLanguage == Language.English)
return "Phone number";
else
return "Puhelinnumero";
}
else if (this.txtEmail.Text.Trim().Length < 5)
{
if (currentLanguage == Language.English)
return "Email";
else
return "Sähköposti";
}
else if (this.txtAdress.Text.Trim().Length < 2)
{
if (currentLanguage == Language.English)
return "Address";
else
return "Lähiosoite";
}
else if (this.txtZip.Text.Trim().Length != 5 || (!int.TryParse(this.txtZip.Text.Trim(), out tmp)))
{
if (currentLanguage == Language.English)
return "Zip code";
else
return "Postinumero";
}
else if (this.txtCity.Text.Trim().Length < 2)
{
if (currentLanguage == Language.English)
return "City";
else
return "Paikkakunta";
}
/*
else if (this.cbTicketType.SelectedIndex == 0)
{
if (currentLanguage == Language.English)
return "Ticket type";
else
return "Lipun tyyppi";
}*/
else
{
return null;
}
}
void wc_RecievedFrame(object sender, WebCameraEventArgs e)
{
if (freeze)
{
this.pbIncoming.Refresh();
return;
}
img = (Image)e.Bitmap;
img.RotateFlip(RotateFlipType.RotateNoneFlipY);
this.pbIncoming.Image = BitmapFilter.Crop(img, RetangleWidth, RetangleHeight, ImageFilters.BitmapFilter.AnchorPosition.Free, 220, 220);
}
int groupId;
private void Form1_Load(object sender, EventArgs e)
{
if (AutoUpdateLib.AutoUpdateCore.CheckForUpdates(null))
{
Application.ExitThread(); //program is required to close by autoupdate (probably updated)
return;
}
this.cmbGender.SelectedIndex = 0;
MessageBox.Show("Ohjelman saa sammutettua ikkunan tyhjästä kohdasta hiiren kakkosnapilla", "Tiedoksi", MessageBoxButtons.OK, MessageBoxIcon.Information);
//getTicketTypes();
/*
object orid = Objects.Pool.ExecScalar("SELECT id FROM ryhmat WHERE nimi = 'Vectorama' LIMIT 1");
if (orid == null || orid is DBNull)
{
MessageBox.Show("Oletusryhmää nimellä Vectorama ei löydy. Luo sellainen esim. seuraavalla queryllä:" + @"
insert into ryhmat (tunnus, deleted, pass, type, state, liput_alku, liput_loppu, toimitus, luotu, otettu, nimi, tietoja)
values ('99998', 0, '123451234512345123451234512345ab', 0, 3, null, null, 0, 1207561742, null, 'Vectorama', '');", "Oletusryhmä puuttuu", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
groupId = Convert.ToInt32(orid);
if (groupId < 1)
{
MessageBox.Show("Vectorama-ryhmällä on virheellinen ID-numero " + groupId, "Virheellinen ID oletusryhmällä", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
*/
this.wc = new WebCamera(this.panel1.Handle, 800, 600); // TODO viimeiseen kenttään conffista kameran numero
wc.RecievedFrame += new WebCamera.RecievedFrameEventHandler(wc_RecievedFrame);
if (!this.wc.StartWebCam())
{
MessageBox.Show("Error in connection with camera", "Error in connection with camera", MessageBoxButtons.OK, MessageBoxIcon.Error);
wc = null;
btnTakePic.Visible = false;
}
}
/*
void getTicketTypes()
{
SelectCreator sc = new SelectCreator("cardtypes");
sc.Fields.Add("id");
sc.Fields.Add("description");
sc.Where.AddTerm("active = true");
sc.Orderby.Add("id");
NpgsqlDataReader dr = Objects.Pool.ExecReader(sc.CreateSQL());
this.cbTicketType.Items.Clear();
this.cbTicketType.Items.Add(new TicketType(0, "-"));
while (dr.Read())
{
this.cbTicketType.Items.Add(new TicketType((int) dr["id"], (string) dr["description"]));
}
this.cbTicketType.SelectedIndex = 1;
dr.Close();
Objects.Pool.ReleaseConn(dr);
}*/
bool pictureTaken;
private void btnFinnish_Click(object sender, EventArgs e)
{
currentLanguage = Language.Finnish;
label1.Text = "Nimi:";
label2.Text = "Lempinimi / Nick:";
//label3.Text = "Lipun tyyppi:";
label4.Text = "Sähköpostiosoite:";
label5.Text = "Lähiosoite:";
label6.Text = "Postinumero:";
label7.Text = "Ikä:";
label8.Text = "Paikkakunta:";
label9.Text = "Puhelin:";
label10.Text = "Sukupuoli:";
label11.Text = "Sukunimi";
btnClear.Text = "Tyhjennä";
label12.Text = "Käyttäjänimi";
label13.Text = "Salasana";
label14.Text = "Salasana uudelleen";
this.cmbGender.Items.Clear();
this.cmbGender.Items.Add("En tiedä");
this.cmbGender.Items.Add("Mies");
this.cmbGender.Items.Add("Nainen");
this.cmbGender.SelectedIndex = 0;
if (freeze)
{
btnTakePic.Text = "Ota uusi kuva";
}
else
{
btnTakePic.Text = "Käytä tätä kuvaa";
}
btnSave.Text = "Tallenna";
this.cmbGender.Items[0] = "En tiedä";
}
private void btnEnglish_Click(object sender, EventArgs e)
{
currentLanguage = Language.English;
label1.Text = "First name:";
label2.Text = "Nickname:";
//label3.Text = "Ticket type:";
label4.Text = "E-Mail:";
label5.Text = "Address:";
label6.Text = "Zip:";
label7.Text = "Age:";
label8.Text = "City:";
label9.Text = "Phone:";
label10.Text = "Gender:";
label11.Text = "Last name:";
label12.Text = "Käyttäjänimi:";
label13.Text = "Passowrd:";
label14.Text = "Password again";
btnClear.Text = "Clear";
this.cmbGender.Items.Clear();
this.cmbGender.Items.Add("I don't know");
this.cmbGender.Items.Add("Male");
this.cmbGender.Items.Add("Female");
this.cmbGender.SelectedIndex = 0;
if (freeze)
{
btnTakePic.Text = "Take a new picture";
}
else
{
btnTakePic.Text = "Use current picture";
}
btnSave.Text = "Save";
this.cmbGender.Items[0] = "I don't know";
}
private void btnClear_Click(object sender, EventArgs e)
{
string msg, caption;
if (currentLanguage == Language.English)
{
msg = "Are you sure you want to clear the fields?";
caption = "Confirmation";
}
else
{
msg = "Haluatko varmasti nollata kentät?";
caption = "Varmistus";
}
DialogResult r = MessageBox.Show(msg, caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (r != DialogResult.OK)
return;
clear();
}
void clear()
{
this.cmbGender.SelectedIndex = 0;
txtAdress.Text = "";
txtAge.Text = "";
txtCity.Text = "";
txtEmail.Text = "";
txtName.Text = "";
txtNick.Text = "";
txtPhone.Text = "";
txtZip.Text = "";
btnSave.Enabled = false;
this.pbIncoming.Image = null;
//this.cbTicketType.SelectedIndex = 1;
pictureTaken = false;
changed();
}
bool checkSaveSafety()
{
//check nickname usage
if (false)
{
if (currentLanguage == Language.English)
{
MessageBox.Show("Nickname '"+this.txtNick.Text+"' already in use. Please choose another one.", "Nickname in use", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.lblMessage.Text = "Choose another nickname";
}
else
{
MessageBox.Show("Nimimerkki '"+this.txtNick.Text+"' on jo käytössä. Valitsetko toisen nimimerkin.", "Nick käytössä", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.lblMessage.Text = "Valitse toinen nick";
}
return false;
}
return true;
}
private void btnSave_Click(object sender, EventArgs e)
{
if (!checkSaveSafety())
{
this.btnSave.Enabled = false;
return;
}
this.Cursor = Cursors.WaitCursor;
this.btnSave.Enabled = false;
this.Enabled = false;
this.btnSave.Refresh();
//savePicture(pid);
if (currentLanguage == Language.English)
{
MessageBox.Show("Save successful.\r\nNow, to to the infodesk and tell them this number and they will tell you what to do.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Tallennus onnistui.\r\nMene infotiskille, ja kerro heille tämä numero, niin he opastavat sinut eteenpäin.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
clear();
this.Enabled = true;
this.Cursor = Cursors.Default;
}
void savePicture(int pid)
{
MemoryStream imageStream = new MemoryStream();
this.pbIncoming.Image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
imageStream.Position = 0;
byte[] imageContent = new Byte[imageStream.Length];
imageStream.Read(imageContent, 0, (int)imageStream.Length);
//Objects.Pool.ExecNonQuery("UPDATE kortit SET kuva = :bytesData WHERE id=" + pid, new Npgsql.NpgsqlParameter(":bytesData", imageContent));
return;
}
bool allowShutdown;
private void txtName_TextChanged(object sender, EventArgs e)
{
changed();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (!allowShutdown)
{
e.Cancel = true;
}
else
{
if (wc != null)
this.wc.CloseWebcam();
}
}
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;
}
}
public WebCamera wc;
bool freeze;
private void btnTakePic_Click(object sender, EventArgs e)
{
this.btnTakePic.Enabled = false;
this.Cursor = Cursors.WaitCursor;
this.btnTakePic.Refresh();
if (freeze)
{
freeze = false;
this.wc.StartWebCam();
if (currentLanguage == Language.English)
{
this.btnTakePic.Text = "Use current picture";
}
else
{
this.btnTakePic.Text = "Käytä tätä kuvaa";
}
pictureTaken = false;
changed();
}
else
{
freeze = true;
this.wc.CloseWebcam();
if (currentLanguage == Language.English)
{
this.btnTakePic.Text = "Take a new picture";
}
else
{
this.btnTakePic.Text = "Ota uusi kuva";
}
pictureTaken = true;
changed();
}
this.Cursor = Cursors.Default;
this.btnTakePic.Enabled = true;
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
/* if (e.Button == MouseButtons.Right)
{
allowShutdown = true;
Application.Exit();
return;
}*/
}
private void txtNick_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtAge_TextChanged(object sender, EventArgs e)
{
changed();
}
private void cmbGender_SelectedIndexChanged(object sender, EventArgs e)
{
changed();
}
private void txtPhone_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtEmail_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtAdress_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtZip_TextChanged(object sender, EventArgs e)
{
changed();
}
private void txtCity_TextChanged(object sender, EventArgs e)
{
changed();
}
private void cbTicketType_SelectedIndexChanged(object sender, EventArgs e)
{
changed();
}
private void lbMessage_Click(object sender, EventArgs e)
{
}
private void label13_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
allowShutdown = true;
Application.Exit();
}
}
}
<?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.Drawing" name="System.Drawing, Version=2.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>v3.5</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>
</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>
</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>
</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.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>
<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="TicketType.cs" />
<Compile Include="Util.cs" />
<Compile Include="videosource\Core.cs" />
<Compile Include="videosource\Events.cs" />
<Compile Include="videosource\IVideoSource.cs" />
<Compile Include="videosource\IVideoSourceDescription.cs" />
<Compile Include="videosource\IVideoSourcePage.cs" />
<Compile Include="WebCamera.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<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>
<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 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaSignup", "MoyaSignup.csproj", "{7264F333-9419-4208-AA6D-223D4CE19C05}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
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}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Any CPU.Build.0 = 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);
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.18408
//
// 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.18408
//
// 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", "10.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;
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
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("'", @"\'");
}
}
}
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace WebCam
{
public class WebCameraEventArgs : EventArgs
{
private System.Drawing.Bitmap bitMap;
private byte[] data;
public WebCameraEventArgs(byte[] videoData, System.Drawing.Bitmap bmp)
{
data = videoData;
bitMap = bmp;
}
public byte[] Data
{
get
{
return data;
}
}
public System.Drawing.Bitmap Bitmap
{
get
{
return bitMap;
}
}
}
public class WebCamera
{
public WebCamera(IntPtr handle, int width, int height)
{
mControlPtr = handle;
mWidth = width;
mHeight = height;
}
// delegate for frame callback
public delegate void RecievedFrameEventHandler(object sender,WebCameraEventArgs e);
public event RecievedFrameEventHandler RecievedFrame;
private IntPtr lwndC; // Holds the unmanaged handle of the control
private IntPtr mControlPtr; // Holds the managed pointer of the control
private int mWidth;
private int mHeight;
private API32.FrameEventHandler mFrameEventHandler; // Delegate instance for the frame callback - must keep alive! gc should NOT collect it
// Close the web camera
public void CloseWebcam()
{
this.capDriverDisconnect(this.lwndC);
}
// start the web camera
public bool StartWebCam()
{
byte[] lpszName = new byte[100];
byte[] lpszVer = new byte[100];
API32.capGetDriverDescriptionA(0, lpszName, 100, lpszVer, 100);
this.lwndC = API32.capCreateCaptureWindowA(lpszName, API32.WS_VISIBLE + API32.WS_CHILD, 0, 0, mWidth, mHeight, mControlPtr, 0);
if (this.capDriverConnect(this.lwndC, 0))
{
this.capPreviewRate(this.lwndC, 100);
//this.capPreview(this.lwndC, false); // resurssi, pivitetnk kuvaa jatkuvasti
API32.BITMAPINFO bitmapinfo = new API32.BITMAPINFO();
bitmapinfo.bmiHeader.biSize = API32.SizeOf(bitmapinfo.bmiHeader);
bitmapinfo.bmiHeader.biWidth = mWidth;
bitmapinfo.bmiHeader.biHeight = mHeight;
bitmapinfo.bmiHeader.biPlanes = 1;
bitmapinfo.bmiHeader.biBitCount = 24;
this.capSetVideoFormat(this.lwndC, ref bitmapinfo, API32.SizeOf(bitmapinfo));
this.mFrameEventHandler = new API32.FrameEventHandler(FrameCallBack);
this.capSetCallbackOnFrame(this.lwndC, this.mFrameEventHandler);
API32.SetWindowPos(this.lwndC, 0, 0, 0, mWidth, mHeight, 6);
return true;
}
return false;
}
// private functions
private bool capDriverConnect(IntPtr lwnd, short i)
{
return API32.SendMessage(lwnd, API32.WM_CAP_DRIVER_CONNECT, i, 0);
}
private bool capDriverDisconnect(IntPtr lwnd)
{
return API32.SendMessage(lwnd, API32.WM_CAP_DRIVER_DISCONNECT, 0, 0);
}
private bool capPreview(IntPtr lwnd, bool f)
{
return API32.SendMessage(lwnd, API32.WM_CAP_SET_PREVIEW, f, 0);
}
private bool capPreviewRate(IntPtr lwnd, short wMS)
{
return API32.SendMessage(lwnd, API32.WM_CAP_SET_PREVIEWRATE, wMS, 0);
}
private bool capSetCallbackOnFrame(IntPtr lwnd, API32.FrameEventHandler lpProc)
{
return API32.SendMessage(lwnd, API32.WM_CAP_SET_CALLBACK_FRAME, 0, lpProc);
}
private bool capSetVideoFormat(IntPtr hCapWnd, ref API32.BITMAPINFO BmpFormat, int CapFormatSize)
{
return API32.SendMessage(hCapWnd, API32.WM_CAP_SET_VIDEOFORMAT, CapFormatSize, ref BmpFormat);
}
private bool capDlgVideoFormat(IntPtr lwnd)
{
return API32.SendMessage(lwnd, API32.WM_CAP_DLG_VIDEOFORMAT, 0, 0);
}
public void ShowConfigDialog()
{
CloseWebcam();
byte[] lpszName = new byte[100];
byte[] lpszVer = new byte[100];
API32.capGetDriverDescriptionA(0, lpszName, 100,lpszVer, 100);
this.lwndC = API32.capCreateCaptureWindowA(lpszName, API32.WS_VISIBLE + API32.WS_CHILD, 0, 0, mWidth, mHeight, mControlPtr, 0);
if (capDriverConnect(this.lwndC ,0))
{
capDlgVideoFormat(this.lwndC);
CloseWebcam();
}
else
throw new Exception("Camera not found");
}
private void FrameCallBack(IntPtr lwnd, IntPtr lpVHdr)
{
API32.VIDEOHDR videoHeader = new API32.VIDEOHDR();
byte[] VideoData;
videoHeader = (API32.VIDEOHDR)API32.GetStructure(lpVHdr, videoHeader);
VideoData = new byte[videoHeader.dwBytesUsed];
API32.Copy(videoHeader.lpData, VideoData);
System.Drawing.Bitmap bmp = new Bitmap(mWidth, mHeight);
System.Drawing.Imaging.BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, mWidth, mHeight), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
//System.Drawing.Imaging.BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, mWidth, mHeight), ImageLockMode.ReadWrite, PixelFormat.);
// Copy the data from memory to the Scan0 property of our Bitmap
/* int l = VideoData.Length;
for (int i = 0; i < l; i++)
{
Marshal.WriteByte(bmpData.Scan0, i, VideoData[i]);
}
*/
Marshal.Copy(VideoData, 0, bmpData.Scan0, VideoData.Length);
bmp.UnlockBits(bmpData);
if (this.RecievedFrame != null)
{
WebCameraEventArgs e = new WebCameraEventArgs(VideoData, bmp);
this.RecievedFrame(this,e);
}
}
}
}
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>
<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>
</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
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);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!