/// /// Version 1.0 /// ===================================================================================================== /// Copyright by Ralf Wiessner, wiessner@brainstrust.com /// 5-Feb-2005 /// Some articles at "CodeProject" helped my to start up the image manipulation smoothly. /// This sourcecode is under copyright. Everyone who likes to use this program can do so, as long as /// my name and copyright is included in the program and source, even if the source is modified. /// I don't guarantee any function and can not be made responsible for any error, outage, exident or /// whatever happens while using this program. Usage is at your own risk. /// ===================================================================================================== /// /// /// Modification history: /// 09-Feb-2005 /// - add setup routine using Nullsoft Scriptable Install System software (nsis.sourceforge.net) /// /// 12-Feb-2005 /// - enhancements of configuration settings (e.g. banner text and icons are not longer hard coded) /// - added support for network credentials (user/password) to access a webcam where anonymous access is disabled /// - added webproxy support /// /// /// /// Description: /// - - - - - - - /// /// Some low-cost WebCams, like the Axis205 does'nt have an build in ftp client, even it's operating system /// is linux based. /// WebCamConsole (WCC) serves as an intermediate process between LAN based WebCams (like Axis205) and /// a FTP server. /// In addition to the transfer function, WebCamConsole is able to add a text banner and two logo's /// into the picture. /// /// How to use it: /// - - - - - - - - /// - Create a directory (e.g. c:\WebCamConsole) and put the following files into it: /// - WebCamConsole.exe (the main program) /// - WebCamConsole.exe.config(xml based configuration file - standard .NET app.config) /// - edtftpnet-1.1.4.dll (a third party ftp component) /// - IVBNWebCamLib.dll (contains the image manipulation code) /// - rightlogo.ico (first logo at the right side of the screen) /// - leftlogo.ico (second logo at the left side of the screen) /// /// ##### If you use the installer version, these files are copied into the directory you specified at installation ##### /// /// - Open a CMD window (Start-Execute-CMD) /// - navigate to c:\WebCamConsole (or whatever your installation path is) /// - type in CMD window: notepad WebCamCOnsole.exe.config /// Scroll down to the configuration section. /// Edit the "webcam.url" key and fill in the url of your webcam /// Edit username and password according to your requirements. If anonymous access /// is enabled on your webcam, just leave these fields blank - but don't remove the lines!!! /// Scroll down to the ftp settings and configure your ftp server here. /// Save this file. /// /// - Now, start WebCamConsole.exe inside the command window /// WCC will read the config file, retrieves the image from the webcam, adds the banner, logos etc, /// saves the image localy as JPEG-File and transfers the image to the FTP-Server. /// - to analyse problems you can change the key "edtftp.log.level" in the configuration file and /// raise the log level to DEBUG or ALL. The console will now start logging the program output. /// Test your config values in a CMD window using the standard windows ftp client. Most problems are /// based on wrong hostname, user/password combinations or just the settings on the ftp server /// not allowing to write into the directory you specified. /// - Also test the webcam url by using a web browser and the configured webcam.url value. /// - If you have a web proxy in your network which connects you to the internet, this /// proxy has to be configured in the Internet-Explorer's Connection-Settings. /// Additionaly you can configure your webproxy in the applications config file. /// - If you still encounter problems - send me a mail with the symptoms, console output and your /// configuration file to wiessner@brainstrust.com. I'll try to help you out. /// - If you like to use your own logo's, just replace the files rightlogo.ico and leftlogo.ico /// with your own. They don't have to be Icon-files. Every file type which is accepted by the /// the .NET Framework could be used. The size should be in the range of 48x48 to 64x64 pixels. /// If you don't like a logo in you picture, just delete the logo files out of the directory. /// /// - To automate the recurring upload, just add an entry into the windows scheduler using control panel /// I personaly run the program every 5 minutes, from 7am the morning to 5pm in the evening. /// /// /// Missing features: /// - - - - - - - - - /// - Configuration using the app.config is nice, but also has its draw backs. /// To access more than one camera, you have to copy the whole WCC programm directory to a /// different directory, because you can not specify multiple WebCams in the config file and /// it is not possible (for my knowledge) to the a .NET application which config file to use. /// A future version eventualy can be configured using console command parameters to allow a /// single copy of the program to handle more than one webcam. /// But it will still be necessary to start two copies of the program, each with an own set /// of input parameters. /// - A GUI to configure and preview the settings in the config file would be nice. /// Such a GUI could also provide an interface to the task scheduler /// - configure positions and occurance of the banner and logo's in config file /// - configure positions, Font and Colors of the banner texts in config file /// /// /// /// WebCamConsole is configured using a XML config file, the .NET standard app.config. /// The following keywords are used to configure the behaivor of WCC: /// /// local.image.path - example value : c:\temp\ /// WCC retrieves the camera picture using a HTTP request into Memory /// Title-Banner, Logos and Alpha-blending is added to the picture /// After that, it is saved to the location specified in local.image.path /// /// webcam.url - example value : http://axis.bn.br.com/axis-cgi/jpg/image.cgi?resolution=320x240;camera=1;compression=50;color=1 /// Source of the picture /// /// webcam.username - example value : guest /// If the webcam is secured by username/password, you can specify these values here /// /// webcam.password - example value : guestpassword /// If the webcam is secured by username/password, you can specify these values here /// /// /// webcam.filename - example value : myWebcam /// This name will be used to construct the filename for local an remote /// store. /// /// webcam.filename.addDatetime /// - example value : true | false /// this option appends the current date and time as suffix to the filename /// value="true" results in filename like "myWebcam_2005-02-03T225557.jpg" /// value="false" results in filename like "myWebcam.jpg" /// /// webcam.image.banner_enabled /// - example value : true | false /// this option enables or disables the banner and icon display at the picture. /// If icons should be displayed without banner, set webcam.image.bannertransparency = 100 ! /// /// webcam.image.bannerheader /// - example value : "This is my little house in Bad Nauheim - Germany" /// Text is displayed at top position /// /// webcam.image.bannertext - example value : "look at this nice place" /// Text is displayed beneath the header text /// /// webcam.image.bannerdisplaydatetime /// - example value : true | false /// this option enables or disables the display of the current date and time in the bottom right corner /// /// webcam.image.bannerabovepicture /// - example value : true | false /// this option enables or disables the feature not to overlay the banner text, but to expand the picture /// height by the size of the banner and display the original picture below the banner. /// With this option enabled, bannertransparency is ignored. /// /// webcam.image.bannertransparency /// - example value : 45 /// this option controls the transparency of the banner /// 0 : no transparency, the banner is opaque /// 100 : full transparency, the banner is invisible /// /// webcam.image.bannerbackgroundcolor /// - example value : blue /// this option controls the color of the banner background /// Currently supported values are: blue, red, yellow, gray, green /// /// webcam.image.iconfile1_enables /// - example value : true | false /// this option controls the display of the left icon /// if set to true, WCC tries to load the file specified in webcam.image.iconfile1 /// /// webcam.image.iconfile1 - example value : "lefticon.ico" or "c:\myIcons\fish.gif" /// if no path is specified, the file is looked up in the current application directory /// If WCC does'nt find the file, no error is reported /// /// webcam.image.iconfile2_enables /// - example value : true | false /// this option controls the display of the right icon /// if set to true, WCC tries to load the file specified in webcam.image.iconfile2 /// /// webcam.image.iconfile2 - example value : "righticon.ico" or "c:\myIcons\fish.gif" /// if no path is specified, the file is looked up in the current application directory /// If WCC does'nt find the file, no error is reported /// /// webcam.image.quality - example value : 65 (as percentage) /// this options requlates the compression of the resulting JPEG image. /// Lower values results in less quality images but smaller files, higher /// values in better quality but bigger files.Default is 65. /// /// proxy.host.name - example value : firewall.bn.br.com (dns name of proxy) /// If this program connects to the webcam through a proxy server, the /// details have to be specified with the add key="proxy.... keywords. /// Leave all proxy.host... keywords commented out, if the connection is direct. /// /// proxy.host.port - example value : 8080 /// port at which the proxy is contacted. Lookup your web browser configuration or /// your network administrator for details. /// /// proxy.host.username - example value : guest /// if your proxy requires authentication, fill in username in this key /// /// proxy.host.password - example value : guestpassword /// if your proxy requires authentication, fill in password in this key /// /// /// /// /// /// webservice.url - example value : http://webcam.internetverein-bad-nauheim.de/uploadPict.asmx /// this is an optional WebService URL. /// WebService Transport is not yet supported. Future versions of WCC /// eventualy will provide this to transport the image to the webserver using HTTP /// even if FTP is blocked by a firewall. /// /// ftp.host.name - example value : www.webcamserver.de /// if transfer is through ftp, this value is used as hostname to connect to the FTP server /// /// ftp.host.username - example value : mywebcamAccount /// Username to login to the FTP server /// /// ftp.host.password - example value : securePassword /// password used to login to the FTP server /// remark: password is send as cleartext as long as not secure ftp connection is used (SFTP) /// /// ftp.host.directory - example value : "webcamdir" or "." /// target directory for uploaded file. /// use "." as default /// /// edtftp.log.level - example value : "WARN" /// the edtftp class comes with a build in logging feature /// this option allows to setup the level of logging /// valid values are : OFF FATAL ERROR WARN INFO DEBUG ALL /// See http://www.enterprisedt.com for further information /// default is "WARN" /// /// /// Programming tipps: /// - - - - - - - - - - /// /// - if you set m_BannerAbovePicture = true, the WebCam Picture is placed beneath the banner. /// the image is enlarged in height by the height of the banner (currently 50pixels). /// - To compile the source you need the following files: /// - WebCamConsole.cs (the main program) /// - App.Config (xml based configuration file)) /// - edtftpnet-1.1.4.dll (a third party ftp component) /// - RetrieveImage.cs (contains the image manipulation code ) /// /// Compile the source using the following command: /// csc /t:exe WebCamConsole.cs RetrieveImage.cs /r:edtftpnet-1.1.4.dll /// /// Rename App.Config to WebCamConsole.exe.config /// /// and you're done! [did I mention, you need the .NET Framework installed :-) ?] /// /// ///