📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

imagecomponents.mvc.imaging-x64

Package Overview
Dependencies
Maintainers
0
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

imagecomponents.mvc.imaging-x64

3.1.3.5
unpublished
NuGet
Version published
Maintainers
0
Created
Source

This NuGet package must be compiled and configured for x86 platforms. Open the configuration manager dialog and set your project platform to x86. After that, the application can run on both x86 and x64 platforms. You can also download the x64 assemblies version from our site: http://www.imagecomponents.net/Downloads/Index/4 Run the example by pressing F5. Navigate to the controller /iccsharpexample or the /icvbexample.

###################################### - Using Image Components Web ImgEdit Component - ######################################

  • Open visual studio and create a new ASP.NET MVC 4 project.

  • Select the 'Basic' template and the 'Razor' view engine.

  • Add a reference to the ImageComponents.Web.Mvc.ImgEdit.dll and to the ImageComponents.Web.Utilities.dll assemblies that can be found on the SDK installation folder\Examples\Assemblies\Web\Mvc\

  • Add a new Controller named HomeController and select the Empty MVC controller template.

  • On the controller code view right click the Index method, press the 'Add View' menu item and uncheck the 'Use a layout or master page'.

  • Include the ImgEdit-vsdoc.js file in the 'Scripts' project folder. This file can be found on the SDK installation folder\Examples\Web\Version4\CSharp\Mvc\IC.Web.Mvc.ImageEditor\Scripts\

  • Add a new JavaScript file to the 'Scripts' folder and name it index.cshtml.js.

  • Open the Index.cshtml view in order to display the HTML source code.

  • Add the following @using or @Imports expression at the top of the Index view: @using ImageComponents.Web.Imaging.Mvc;

  • Add the following script elements to the head of the page:

  • Insert in the beginning of the body element the configuration of the ImgEdit control: @Html.ImgEditManager().ScriptResource().Include(); @Html.ImgEditManager().SetWidth("100%"); @Html.ImgEditManager().SetHeight("100%");

  • Add the ImgEdit control to the div element: @Html.ImgEditManager().Render("imgEdit1")

  • Add an Input (Button) element as:

  • Append the following JavaScript element at the bottom of the Index view: @System.Web.Optimization.Scripts.Render("~/bundles/jquery")

  • The full Index view code may look like this: @using ImageComponents.Web.Imaging.Mvc; Index @Html.ImgEditManager().ScriptResource().Include() @Html.ImgEditManager().SetWidth("400px") @Html.ImgEditManager().SetHeight("500px")

    @Html.ImgEditManager().Render("imgEdit1")
      
    @System.Web.Optimization.Scripts.Render("~/bundles/jquery")

  • Open and add the following JavaScript code to the index.cshtml.js file: /// var _webServiceURL = "http://localhost/IC.Web.Imaging/ImageManagerService.svc"; var _imgEdit = null; //Comment this line on release. This is just for intellisense purposes. _imgEdit = new ImgEdit(); function pageLoad() { //Get the ImgEdit control. _imgEdit.set_WebServiceURL(_webServiceURL); _imgEdit.addEventListener("ErrorOccurred", onErrorOccurred); }

     function openImage() {
     	_imgEdit.DisplayUrl('http://www.imagecomponents.net/Documentation/Doc.tif');
     	_imgEdit.FitTo(ImgEdit.ICImageFit.BESTFIT, true);
     }
    
     function onErrorOccurred(s, e) {
     	alert("One error occurred in the control '" + e.ControlName + "'.\r\nThe error detail in the method '" + e.MethodName +
     		"' is as follows:\r\n\r\n" + e.ErrorMessage + "\r\n\r\nSorry for this inconvenient. ");
     }
    
  • Run the application by pressing the F5 key or by clicking the play button on Visual Studio.

  • Click the 'Open' button and it should display an example tif image file.

###################################### - Using Image Components Web ImgThumbnails Component - ######################################

  • Open the previous ASP.NET MVC 4 project.

  • Add a reference to the ImageComponents.Web.Mvc.ImgThumbnails.dll assembly that can be found on the SDK installation folder\Examples\Assemblies\Web\Mvc\

  • Include the ImgThumbnails-vsdoc.js file in the 'Scripts' project folder. This file can be found on the SDK installation folder\Examples\Web\Version4\CSharp\Mvc\IC.Web.Mvc.ImageEditor\Scripts\

  • Open the Index.cshtml view in order to display the HTML source code.

  • Add the following script elements to the head of the page:

  • Insert in the beginning of the body element the configuration of the ImgThumbnails control: @Html.ImgThumbnailsManager().ScriptResource().Include() @Html.ImgThumbnailsManager().SetWidth("150px") @Html.ImgThumbnailsManager().SetHeight("500px")

  • The full HTML code may look like this: @using ImageComponents.Web.Imaging.Mvc; Index @Html.ImgEditManager().ScriptResource().Include() @Html.ImgThumbnailsManager().ScriptResource().Include() @Html.ImgEditManager().SetWidth("400px") @Html.ImgEditManager().SetHeight("500px") @Html.ImgThumbnailsManager().SetWidth("150px") @Html.ImgThumbnailsManager().SetHeight("500px")

     
    @Html.ImgEditManager().Render("imgEdit1") @Html.ImgThumbnailsManager().Render("imgThumbnails1")
    @System.Web.Optimization.Scripts.Render("~/bundles/jquery")

  • Open and add the following JavaScript code to the index.cshtml.js file: /// /// var _webServiceURL = "http://localhost/IC.Web.Imaging/ImageManagerService.svc"; var _imgEdit = null; var _imgThumbnails = null; //Comment the following lines on release. This is just for intellisense purposes. _imgEdit = new ImgEdit(); _imgThumbnails = new ImgThumbnails();

     var _isImgScanDownloading = false;
    
     function pageLoad() {
     	//Get the ImgEdit control.
     	_imgEdit.set_WebServiceURL(_webServiceURL);
     	_imgEdit.addEventListener("ErrorOccurred", onErrorOccurred);
     }
    
     function openImage() {
     	_imgEdit.DisplayUrl('http://www.imagecomponents.net/Documentation/Doc.tif');
     	_imgEdit.FitTo(ImgEdit.ICImageFit.BESTFIT, true);
     }
    
     function onErrorOccurred(s, e) {
     	alert("One error occurred in the control '" + e.ControlName + "'.\r\nThe error detail in the method '" + e.MethodName +
     		"' is as follows:\r\n\r\n" + e.ErrorMessage + "\r\n\r\nSorry for this inconvenient. ");
     }
    
  • Run the application by pressing the F5 key or by clicking the play button on Visual Studio.

  • Click the 'Open' button and it should display an example tif image file and it's pages thumbnails.

###################################### - Using Image Components Web ImgScan Component - ######################################

  • Open the previous ASP.NET MVC 4 project.

  • Add a reference to the ImageComponents.Web.Mvc.ImgScan.dll assembly that can be found on the SDK installation folder\Examples\Assemblies\Web\Mvc\

  • Include the ImgScan-vsdoc.js file in the 'Scripts' project folder. This file can be found on the SDK installation folder\Examples\Web\Version4\CSharp\Forms\IC.Web.ImageEditor\js\

  • Open the Index.cshtml view in order to display the HTML source code.

  • Add an Input (Button) element as:

  • Add the following script elements to the head of the page:

  • Insert in the beginning of the body element the configuration of the ImgScan control: @Html.ImgScanManager().ScriptResource().Include()

  • The full HTML code may look like this: @using ImageComponents.Web.Imaging.Mvc; Index @Html.ImgEditManager().ScriptResource().Include() @Html.ImgThumbnailsManager().ScriptResource().Include() @Html.ImgScanManager().ScriptResource().Include() @Html.ImgEditManager().SetWidth("400px") @Html.ImgEditManager().SetHeight("500px") @Html.ImgThumbnailsManager().SetWidth("150px") @Html.ImgThumbnailsManager().SetHeight("500px")

     
    @Html.ImgEditManager().Render("imgEdit1") @Html.ImgThumbnailsManager().Render("imgThumbnails1")
    @System.Web.Optimization.Scripts.Render("~/bundles/jquery")

  • Open and add the following JavaScript code to the index.cshtml.js file: /// /// /// var _webServiceURL = "http://localhost/IC.Web.Imaging/ImageManagerService.svc"; var _imgEdit = null; var _imgThumbnails = null; var _imgScan = null; //Comment the following lines on release. This is just for intellisense purposes. _imgEdit = new ImgEdit(); _imgThumbnails = new ImgThumbnails(); _imgScan = new ImgScan();

     var _isImgScanDownloading = false;
    
     function pageLoad() {
     	//Get the ImgEdit control.
     	_imgEdit.set_WebServiceURL(_webServiceURL);
     	_imgEdit.addEventListener("ErrorOccurred", onErrorOccurred);
     	_imgScan.addEventListener("ErrorOccurred", onErrorOccurred);
     	_imgScan.addEventListener("SocketStatusChanged", onSocketStatusChanged);
     	_imgScan.addEventListener("ScanFinished", onScanFinished);
     }
    
     function openImage() {
     	_imgEdit.DisplayUrl('http://www.imagecomponents.net/Documentation/Doc.tif');
     	_imgEdit.FitTo(ImgEdit.ICImageFit.BESTFIT, true);
     }
    
     function scanImage() {
     	//Close existing image if open.
     	_imgEdit.Close();
     	if (_imgScan.ConnectionStatus !== ImgScan.ICWSocketStatus.CONNECTED) {
     		_imgScan.OpenConnection(function () {
     			_imgScan.ActiveSourceName = "TWAIN2 FreeImage Software Scanner";
     			_imgScan.DeviceDriverType = ImgScan.ICDeviceDriverType.TWAIN;
     			_imgScan.DeviceSettings = new ImgScan.ICDeviceSettings();
     			//This is important if you are scanning a multi-page document. You can also set to PDF.
     			_imgScan.DeviceSettings.OutputFormat = ImgScan.ICImageOutputFormat.TIFF;
     			_imgScan.SetTwainSettings = new ImgScan.TwainSettings();
     			_imgScan.SetTwainSettings.Values.TwainICapabilities.ImageXferMech = ImgScan.ICAP_XFERMECH.NATIVE;
     			_imgScan.Acquire();
     		});
     	}
     	else {
     		_imgScan.ActiveSourceName = "TWAIN2 FreeImage Software Scanner";
     		_imgScan.DeviceDriverType = ImgScan.ICDeviceDriverType.TWAIN;
     		_imgScan.DeviceSettings = new ImgScan.ICDeviceSettings();
     		//This is important if you are scanning a multi-page document. You can also set to PDF.
     		_imgScan.DeviceSettings.OutputFormat = ImgScan.ICImageOutputFormat.TIFF;
     		_imgScan.SetTwainSettings = new ImgScan.TwainSettings();
     		_imgScan.SetTwainSettings.Values.TwainICapabilities.ImageXferMech = ImgScan.ICAP_XFERMECH.NATIVE;
     		_imgScan.Acquire();
     	}
     }
    
     //This events are hired up on page load method.
     //On web socket connection.
     function onSocketStatusChanged(s, e) {
     	switch (e) {
     		case ImgScan.ICWSocketStatus.CONNECTING:
    
     			break;
     		case ImgScan.ICWSocketStatus.CONNECTED:
    
     			break;
     		case ImgScan.ICWSocketStatus.CONNECTIONERROR:
     			if (_isImgScanDownloading == false) {
     				if (confirm('Could not connect to the ImgScan twain bridge plugin.\r\nDo you want to download the installation package and try again?')) {
     					_isImgScanDownloading = true;
     					_imgScan.DownloadScanService("http://localhost/IC.Web.Imaging/ImgScan/ICScanService.zip");
     				} else {
     					_imgScan.CloseConnection();
     				}
     			}
     			break;
     		case ImgScan.ICWSocketStatus.RECONNECTING:
    
     			break;
     	}
     }
    
     //On scan finished event.
     function onScanFinished(s, e) {
     	//Upload the image to your server.
     	var _base64Image = e.Stream;
     }
    
     function onErrorOccurred(s, e) {
     	alert("One error occurred in the control '" + e.ControlName + "'.\r\nThe error detail in the method '" + e.MethodName +
     		"' is as follows:\r\n\r\n" + e.ErrorMessage + "\r\n\r\nSorry for this inconvenient. ");
     }
    
  • Run the application by pressing the F5 key or by clicking the play button on Visual Studio.

  • Click the 'Scan' button and it should initiate and display the scanner driver dialog.

###################################### - Using Image Components Web ImgAnnotations Component - ######################################

  • Open the previous ASP.NET MVC 4 project.

  • Add a reference to the ImageComponents.Web.Mvc.ImgAnnotations.dll assembly that can be found on the SDK installation folder\Examples\Assemblies\Web\Mvc\

  • Include the ImgAnnotations-vsdoc.js file in the 'Scripts' project folder. This file can be found on the SDK installation folder\Examples\Web\Version4\CSharp\Forms\IC.Web.ImageEditor\js\

  • Open the Index.cshtml view in order to display the HTML source code.

  • Add an Input (Button) element as:

  • Add the following script elements to the head of the page:

  • Insert in the beginning of the body element the configuration of the ImgAnnotations control: @Html.ImgAnnotationsManager().ScriptResource().Include()

  • The full HTML code may look like this: @using ImageComponents.Web.Imaging.Mvc; Index @Html.ImgEditManager().ScriptResource().Include() @Html.ImgThumbnailsManager().ScriptResource().Include() @Html.ImgScanManager().ScriptResource().Include() @Html.ImgAnnotationsManager().ScriptResource().Include() @Html.ImgEditManager().SetWidth("400px") @Html.ImgEditManager().SetHeight("500px") @Html.ImgThumbnailsManager().SetWidth("150px") @Html.ImgThumbnailsManager().SetHeight("500px")

     
    @Html.ImgEditManager().Render("imgEdit1") @Html.ImgThumbnailsManager().Render("imgThumbnails1")
    @System.Web.Optimization.Scripts.Render("~/bundles/jquery")

  • Open and add the following JavaScript code to the index.cshtml.js file: /// /// /// /// var _webServiceURL = "http://localhost/IC.Web.Imaging/ImageManagerService.svc"; var _imgEdit = null; var _imgThumbnails = null; var _imgScan = null; var _imgAnnotations = null; //Comment the following lines on release. This is just for intellisense purposes. _imgEdit = new ImgEdit(); _imgThumbnails = new ImgThumbnails(); _imgScan = new ImgScan(); _imgAnnotations = new ImgAnnotations();

     var _isImgScanDownloading = false;
    
     function pageLoad() {
     	//Get the ImgEdit control.
     	_imgEdit.set_WebServiceURL(_webServiceURL);
     	_imgEdit.addEventListener("ErrorOccurred", onErrorOccurred);
     	_imgScan.addEventListener("ErrorOccurred", onErrorOccurred);
     	_imgScan.addEventListener("SocketStatusChanged", onSocketStatusChanged);
     	_imgScan.addEventListener("ScanFinished", onScanFinished);
     }
    
     function openImage() {
     	_imgEdit.DisplayUrl('http://www.imagecomponents.net/Documentation/Doc.tif');
     	_imgEdit.FitTo(ImgEdit.ICImageFit.BESTFIT, true);
     }
    
     function scanImage() {
     	//Close existing image if open.
     	_imgEdit.Close();
     	if (_imgScan.ConnectionStatus !== ImgScan.ICWSocketStatus.CONNECTED) {
     		_imgScan.OpenConnection(function () {
     			_imgScan.ActiveSourceName = "TWAIN2 FreeImage Software Scanner";
     			_imgScan.DeviceDriverType = ImgScan.ICDeviceDriverType.TWAIN;
     			_imgScan.DeviceSettings = new ImgScan.ICDeviceSettings();
     			//This is important if you are scanning a multi-page document. You can also set to PDF.
     			_imgScan.DeviceSettings.OutputFormat = ImgScan.ICImageOutputFormat.TIFF;
     			_imgScan.SetTwainSettings = new ImgScan.TwainSettings();
     			_imgScan.SetTwainSettings.Values.TwainICapabilities.ImageXferMech = ImgScan.ICAP_XFERMECH.NATIVE;
     			_imgScan.Acquire();
     		});
     	}
     	else {
     		_imgScan.ActiveSourceName = "TWAIN2 FreeImage Software Scanner";
     		_imgScan.DeviceDriverType = ImgScan.ICDeviceDriverType.TWAIN;
     		_imgScan.DeviceSettings = new ImgScan.ICDeviceSettings();
     		//This is important if you are scanning a multi-page document. You can also set to PDF.
     		_imgScan.DeviceSettings.OutputFormat = ImgScan.ICImageOutputFormat.TIFF;
     		_imgScan.SetTwainSettings = new ImgScan.TwainSettings();
     		_imgScan.SetTwainSettings.Values.TwainICapabilities.ImageXferMech = ImgScan.ICAP_XFERMECH.NATIVE;
     		_imgScan.Acquire();
     	}
     }
    
     function addAnnotation() {
     	_imgAnnotations.EnableAnnotationType = ImgAnnotations.ICAnnotationType.HighlightAnnotation;
     	_imgEdit.EnableSelectionType = ImgEdit.ICSelectionType.ANNOTATIONSELECTION;
     }
    
     //This events are hired up on page load method.
     //On web socket connection.
     function onSocketStatusChanged(s, e) {
     	switch (e) {
     		case ImgScan.ICWSocketStatus.CONNECTING:
    
     			break;
     		case ImgScan.ICWSocketStatus.CONNECTED:
    
     			break;
     		case ImgScan.ICWSocketStatus.CONNECTIONERROR:
     			if (_isImgScanDownloading == false) {
     				if (confirm('Could not connect to the ImgScan twain bridge plugin.\r\nDo you want to download the installation package and try again?')) {
     					_isImgScanDownloading = true;
     					_imgScan.DownloadScanService("http://localhost/IC.Web.Imaging/ImgScan/ICScanService.zip");
     				} else {
     					_imgScan.CloseConnection();
     				}
     			}
     			break;
     		case ImgScan.ICWSocketStatus.RECONNECTING:
    
     			break;
     	}
     }
    
     //On scan finished event.
     function onScanFinished(s, e) {
     	//Upload the image to your server.
     	var _base64Image = e.Stream;
     }
    
     function onErrorOccurred(s, e) {
     	alert("One error occurred in the control '" + e.ControlName + "'.\r\nThe error detail in the method '" + e.MethodName +
     		"' is as follows:\r\n\r\n" + e.ErrorMessage + "\r\n\r\nSorry for this inconvenient. ");
     }
    
  • Run the application by pressing the F5 key or by clicking the play button on Visual Studio.

  • Click the 'Open' button and it should display an example tif image file.

  • Click the 'Add Highlight' button and draw the highlight annotation into the image.

###################################### - Using Image Components Web ImgBarDecoder Component - ######################################

  • Open the previous ASP.NET MVC 4 project.

  • Add a reference to the ImageComponents.Web.Mvc.ImgBarDecoder.dll assembly that can be found on the SDK installation folder\Examples\Assemblies\Web\Mvc\

  • Include the ImgBarDecoder-vsdoc.js file in the 'Scripts' project folder. This file can be found on the SDK installation folder\Examples\Web\Version4\CSharp\Forms\IC.Web.ImageEditor\js\

  • Open the Index.cshtml view in order to display the HTML source code.

  • Add an Input (Button) element as:

  • Add the following script elements to the head of the page:

  • Insert in the beginning of the body element the configuration of the ImgBarDecoder control: @Html.ImgBarDecoderManager().ScriptResource().Include()

  • The full HTML code may look like this: @using ImageComponents.Web.Imaging.Mvc; Index @Html.ImgEditManager().ScriptResource().Include() @Html.ImgThumbnailsManager().ScriptResource().Include() @Html.ImgScanManager().ScriptResource().Include() @Html.ImgAnnotationsManager().ScriptResource().Include() @Html.ImgBarDecoderManager().ScriptResource().Include() @Html.ImgEditManager().SetWidth("400px") @Html.ImgEditManager().SetHeight("500px") @Html.ImgThumbnailsManager().SetWidth("150px") @Html.ImgThumbnailsManager().SetHeight("500px")

     
    @Html.ImgEditManager().Render("imgEdit1") @Html.ImgThumbnailsManager().Render("imgThumbnails1")
    @System.Web.Optimization.Scripts.Render("~/bundles/jquery")

  • Open and add the following JavaScript code to the index.cshtml.js file: /// /// /// /// /// var _webServiceURL = "http://localhost/IC.Web.Imaging/ImageManagerService.svc"; var _imgEdit = null; var _imgThumbnails = null; var _imgScan = null; var _imgAnnotations = null; var _imgBarDecoder = null; //Comment the following lines on release. This is just for intellisense purposes. _imgEdit = new ImgEdit(); _imgThumbnails = new ImgThumbnails(); _imgScan = new ImgScan(); _imgAnnotations = new ImgAnnotations(); _imgBarDecoder = new ImgBarDecoder();

     var _isImgScanDownloading = false;
    
     function pageLoad() {
     	//Get the ImgEdit control.
     	_imgEdit.set_WebServiceURL(_webServiceURL);
     	_imgEdit.addEventListener("ErrorOccurred", onErrorOccurred);
     	_imgScan.addEventListener("ErrorOccurred", onErrorOccurred);
     	_imgScan.addEventListener("SocketStatusChanged", onSocketStatusChanged);
     	_imgScan.addEventListener("ScanFinished", onScanFinished);
     	_imgBarDecoder.addEventListener("ScanFinished", onBarcodeScanFinished);
     }
    
     function openImage() {
     	_imgEdit.DisplayUrl('http://www.imagecomponents.net/Documentation/Doc.tif');
     	_imgEdit.FitTo(ImgEdit.ICImageFit.BESTFIT, true);
     }
    
     function scanImage() {
     	//Close existing image if open.
     	_imgEdit.Close();
     	if (_imgScan.ConnectionStatus !== ImgScan.ICWSocketStatus.CONNECTED) {
     		_imgScan.OpenConnection(function () {
     			_imgScan.ActiveSourceName = "TWAIN2 FreeImage Software Scanner";
     			_imgScan.DeviceDriverType = ImgScan.ICDeviceDriverType.TWAIN;
     			_imgScan.DeviceSettings = new ImgScan.ICDeviceSettings();
     			//This is important if you are scanning a multi-page document. You can also set to PDF.
     			_imgScan.DeviceSettings.OutputFormat = ImgScan.ICImageOutputFormat.TIFF;
     			_imgScan.SetTwainSettings = new ImgScan.TwainSettings();
     			_imgScan.SetTwainSettings.Values.TwainICapabilities.ImageXferMech = ImgScan.ICAP_XFERMECH.NATIVE;
     			_imgScan.Acquire();
     		});
     	}
     	else {
     		_imgScan.ActiveSourceName = "TWAIN2 FreeImage Software Scanner";
     		_imgScan.DeviceDriverType = ImgScan.ICDeviceDriverType.TWAIN;
     		_imgScan.DeviceSettings = new ImgScan.ICDeviceSettings();
     		//This is important if you are scanning a multi-page document. You can also set to PDF.
     		_imgScan.DeviceSettings.OutputFormat = ImgScan.ICImageOutputFormat.TIFF;
     		_imgScan.SetTwainSettings = new ImgScan.TwainSettings();
     		_imgScan.SetTwainSettings.Values.TwainICapabilities.ImageXferMech = ImgScan.ICAP_XFERMECH.NATIVE;
     		_imgScan.Acquire();
     	}
     }
    
     function addAnnotation() {
     	_imgAnnotations.EnableAnnotationType = ImgAnnotations.ICAnnotationType.HighlightAnnotation;
     	_imgEdit.EnableSelectionType = ImgEdit.ICSelectionType.ANNOTATIONSELECTION;
     }
    
     function readBarcodes() {
     	_imgBarDecoder.ImageBarcodeTypes = [];
     	_imgBarDecoder.ImageBarcodeTypes.push(ImgBarDecoder.ICImageBarcodeType.CODE39);
     	_imgBarDecoder.ImageBarcodeOrientations = [];
     	_imgBarDecoder.ImageBarcodeOrientations.push(ImgBarDecoder.ICImageBarcodeOrientation.LEFTTORIGHT);
     	_imgBarDecoder.StopOnFirstResult = false;
     	_imgBarDecoder.ExtensiveSearch = true;
     	_imgBarDecoder.EnableCheckDigit = false;
     	_imgBarDecoder.ImageBarcodePageType = ImgBarDecoder.ICImageBarcodePageType.SELECTEDPAGE;
     	_imgBarDecoder.ReadBarcodes();
     }
    
     function getEnumValue(enumObj, key) {
     	for (var obj in enumObj) {
     		if (enumObj[obj] === key) {
     			return obj;
     		}
     	}
     	return null;
     }
    
     //This events are hired up on page load method.
     //On web socket connection.
     function onSocketStatusChanged(s, e) {
     	switch (e) {
     		case ImgScan.ICWSocketStatus.CONNECTING:
    
     			break;
     		case ImgScan.ICWSocketStatus.CONNECTED:
    
     			break;
     		case ImgScan.ICWSocketStatus.CONNECTIONERROR:
     			if (_isImgScanDownloading == false) {
     				if (confirm('Could not connect to the ImgScan twain bridge plugin.\r\nDo you want to download the installation package and try again?')) {
     					_isImgScanDownloading = true;
     					_imgScan.DownloadScanService("http://localhost/IC.Web.Imaging/ImgScan/ICScanService.zip");
     				} else {
     					_imgScan.CloseConnection();
     				}
     			}
     			break;
     		case ImgScan.ICWSocketStatus.RECONNECTING:
    
     			break;
     	}
     }
    
     //On scan finished event.
     function onScanFinished(s, e) {
     	//Upload the image to your server.
     	var _base64Image = e.Stream;
     }
    
     //On barcode scan finished event.
     function onBarcodeScanFinished(s, e) {
     	if (_imgBarDecoder.ReadedBarcodesResults != null && _imgBarDecoder.ReadedBarcodesResults.length > 0) {
     		var _resultValue = "";
    
     		for (var i = 0; i < _imgBarDecoder.ReadedBarcodesResults.length; i++) {
     			var _result = _imgBarDecoder.ReadedBarcodesResults[i];
     			_resultValue += "Barcode type: " + getEnumValue(ImgBarDecoder.ICImageBarcodeType, _result.BarcodeType) + "\r\n" +
     							"Barcode result: " + _result.Text + "\r\n\r\n";
     		}
     		alert(_resultValue);
     	}
     }
    
     function onErrorOccurred(s, e) {
     	alert("One error occurred in the control '" + e.ControlName + "'.\r\nThe error detail in the method '" + e.MethodName +
     		"' is as follows:\r\n\r\n" + e.ErrorMessage + "\r\n\r\nSorry for this inconvenient. ");
     }
    
  • Run the application by pressing the F5 key or by clicking the play button on Visual Studio.

  • Click the 'Open' button and it should display an example tif image file.

  • Click the 'Read Barcodes' button to read the image CODE39 barcode.

Keywords

ASP.NET

FAQs

Package last updated on 22 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts