Permalink
Browse files

Merge pull request #670 from rmituniewicz/barcodeWindows

[WP7] BarcodeScanner port to Windows Phone 7.5
  • Loading branch information...
2 parents 858dae2 + 151f61c commit d1bdd99a50c4a3c3d98fe5a8560cbf9086f5d225 @shazron shazron committed Aug 28, 2012
Showing with 23,689 additions and 0 deletions.
  1. +62 −0 WindowsPhone/BarcodeScanner/deploy/BarcodeScanner.cs
  2. BIN WindowsPhone/BarcodeScanner/deploy/BarcodeScanner.dll
  3. +10 −0 WindowsPhone/BarcodeScanner/deploy/README.md
  4. BIN WindowsPhone/BarcodeScanner/deploy/ZXingVer1_7.dll
  5. +79 −0 WindowsPhone/BarcodeScanner/deploy/barcodescanner.js
  6. +82 −0 WindowsPhone/BarcodeScanner/sources/BarcodeScanner/BarcodeScanner.csproj
  7. +12 −0 WindowsPhone/BarcodeScanner/sources/BarcodeScanner/BarcodeScanner.csproj.user
  8. +34 −0 WindowsPhone/BarcodeScanner/sources/BarcodeScanner/PhotoCameraLuminanceSource.cs
  9. +37 −0 WindowsPhone/BarcodeScanner/sources/BarcodeScanner/Properties/AssemblyInfo.cs
  10. +49 −0 WindowsPhone/BarcodeScanner/sources/BarcodeScanner/Scanner.xaml
  11. +147 −0 WindowsPhone/BarcodeScanner/sources/BarcodeScanner/Scanner.xaml.cs
  12. +30 −0 WindowsPhone/BarcodeScanner/sources/BarcodeScanner/ScannerResult.cs
  13. +7 −0 WindowsPhone/BarcodeScanner/sources/README.md
  14. +62 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/AssemblyInfo.cs
  15. +110 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/BarcodeFormat.cs
  16. +93 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/Binarizer.cs
  17. +161 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/BinaryBitmap.cs
  18. +78 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/DecodeHintType.cs
  19. +43 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/EncodeHintType.cs
  20. +140 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/LuminanceSource.cs
  21. +184 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/MultiFormatReader.cs
  22. +64 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/MultiFormatWriter.cs
  23. +35 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/Properties/AssemblyInfo.cs
  24. +174 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/RGBLuminanceSource.cs
  25. +66 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/Reader.cs
  26. +113 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/ReaderException.cs
  27. +132 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/Result.cs
  28. +68 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/ResultMetadataType.cs
  29. +157 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/ResultPoint.cs
  30. +31 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/ResultPointCallback.cs
  31. +216 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/SupportClass.cs
  32. +63 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/Writer.cs
  33. +40 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/WriterException.cs
  34. +203 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/ZXingVer1_7.csproj
  35. +45 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/AbstractDoCoMoResultParser.cs
  36. +81 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/AddressBookAUResultParser.cs
  37. +85 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/AddressBookDoCoMoResultParser.cs
  38. +169 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/AddressBookParsedResult.cs
  39. +99 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/BizcardResultParser.cs
  40. +53 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/BookmarkDoCoMoResultParser.cs
  41. +172 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/CalendarParsedResult.cs
  42. +88 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/EmailAddressParsedResult.cs
  43. +75 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/EmailAddressResultParser.cs
  44. +101 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/EmailDoCoMoResultParser.cs
  45. +131 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/GeoParsedResult.cs
  46. +78 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/GeoResultParser.cs
  47. +51 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/ISBNParsedResult.cs
  48. +63 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/ISBNResultParser.cs
  49. +90 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/ParsedResult.cs
  50. +72 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/ParsedResultType.cs
  51. +66 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/ProductParsedResult.cs
  52. +77 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/ProductResultParser.cs
  53. +421 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/ResultParser.cs
  54. +124 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/SMSMMSResultParser.cs
  55. +112 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/SMSParsedResult.cs
  56. +76 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/TelParsedResult.cs
  57. +51 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/TelResultParser.cs
  58. +66 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/TextParsedResult.cs
  59. +148 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/URIParsedResult.cs
  60. +106 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/URIResultParser.cs
  61. +55 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/URLTOResultParser.cs
  62. +232 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/VCardResultParser.cs
  63. +67 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/VEventResultParser.cs
  64. +56 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/optional/AbstractNDEFResultParser.cs
  65. +118 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/optional/NDEFRecord.cs
  66. +87 −0 ...wsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/optional/NDEFSmartPosterParsedResult.cs
  67. +96 −0 ...wsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/optional/NDEFSmartPosterResultParser.cs
  68. +65 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/optional/NDEFTextResultParser.cs
  69. +68 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/client/result/optional/NDEFURIResultParser.cs
  70. +208 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/BitArray.cs
  71. +237 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/BitMatrix.cs
  72. +109 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/BitSource.cs
  73. +116 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/ByteArray.cs
  74. +131 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/ByteMatrix.cs
  75. +130 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/CharacterSetECI.cs
  76. +61 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/Collections.cs
  77. +28 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/Comparator.cs
  78. +89 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/DecoderResult.cs
  79. +82 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/DefaultGridSampler.cs
  80. +60 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/DetectorResult.cs
  81. +66 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/ECI.cs
  82. +250 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/GlobalHistogramBinarizer.cs
  83. +193 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/GridSampler.cs
  84. +187 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/HybridBinarizer.cs
  85. +146 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/PerspectiveTransform.cs
  86. +255 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/detector/MonochromeRectangleDetector.cs
  87. +174 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/reedsolomon/GF256.cs
  88. +328 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/reedsolomon/GF256Poly.cs
  89. +217 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/reedsolomon/ReedSolomonDecoder.cs
  90. +91 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/reedsolomon/ReedSolomonEncoder.cs
  91. +36 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/common/reedsolomon/ReedSolomonException.cs
  92. +172 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/datamatrix/DataMatrixReader.cs
  93. +547 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/datamatrix/decoder/BitMatrixParser.cs
  94. +144 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/datamatrix/decoder/DataBlock.cs
  95. +629 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/datamatrix/decoder/DecodedBitStreamParser.cs
  96. +153 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/datamatrix/decoder/Decoder.cs
  97. +241 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/datamatrix/decoder/Version.cs
  98. +328 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/datamatrix/detector/Detector.cs
  99. +104 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/multi/ByQuadrantReader.cs
  100. +178 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/multi/GenericMultipleBarcodeReader.cs
  101. +41 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/multi/MultipleBarcodeReader.cs
  102. +95 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/multi/qrcode/QRCodeMultiReader.cs
  103. +86 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/multi/qrcode/detector/MultiDetector.cs
  104. +371 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/multi/qrcode/detector/MultiFinderPatternFinder.cs
  105. +445 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/Code128Reader.cs
  106. +393 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/Code39Reader.cs
  107. +82 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/Code39Writer.cs
  108. +154 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/EAN13Reader.cs
  109. +85 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/EAN13Writer.cs
  110. +85 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/EAN8Reader.cs
  111. +79 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/EAN8Writer.cs
  112. +384 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/ITFReader.cs
  113. +99 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/MultiFormatOneDReader.cs
  114. +117 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/MultiFormatUPCEANReader.cs
  115. +337 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/OneDReader.cs
  116. +89 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/UPCAReader.cs
  117. +364 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/UPCEANReader.cs
  118. +146 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/UPCEANWriter.cs
  119. +174 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/oned/UPCEReader.cs
  120. +162 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/pdf417/PDF417Reader.cs
  121. +630 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/pdf417/decoder/BitMatrixParser.cs
  122. +735 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/pdf417/decoder/DecodedBitStreamParser.cs
  123. +171 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/pdf417/decoder/Decoder.cs
  124. +575 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/pdf417/detector/Detector.cs
  125. +181 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/QRCodeReader.cs
  126. +172 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/QRCodeWriter.cs
  127. +241 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/BitMatrixParser.cs
  128. +151 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/DataBlock.cs
  129. +157 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/DataMask.cs
  130. +443 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/DecodedBitStreamParser.cs
  131. +153 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/Decoder.cs
  132. +102 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/ErrorCorrectionLevel.cs
  133. +144 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/FormatInformation.cs
  134. +158 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/Mode.cs
  135. +320 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/decoder/Version.cs
  136. +53 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/detector/AlignmentPattern.cs
  137. +341 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/detector/AlignmentPatternFinder.cs
  138. +424 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/detector/Detector.cs
  139. +77 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/detector/FinderPattern.cs
  140. +650 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/detector/FinderPatternFinder.cs
  141. +69 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/detector/FinderPatternInfo.cs
  142. +196 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/encoder/BitVector.cs
  143. +51 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/encoder/BlockPair.cs
  144. +648 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/encoder/Encoder.cs
  145. +226 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/encoder/MaskUtil.cs
  146. +518 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/encoder/MatrixUtil.cs
  147. +299 −0 WindowsPhone/BarcodeScanner/sources/ZXing7_1Port/qrcode/encoder/QRCode.cs
@@ -0,0 +1,62 @@
+using System.Runtime.Serialization;
+using WP7CordovaClassLib.Cordova;
+using WP7CordovaClassLib.Cordova.Commands;
+using WP7CordovaClassLib.Cordova.JSON;
+using Microsoft.Phone.Shell;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Tasks;
+using System.Windows;
+
+namespace org.apache.cordova
+{
+ public class barcodeScanner : WP7CordovaClassLib.Cordova.Commands.BaseCommand
+ {
+ public void scan(string options)
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ var root = Application.Current.RootVisual as PhoneApplicationFrame;
+
+ root.Navigated += new System.Windows.Navigation.NavigatedEventHandler(root_Navigated);
+
+ root.Navigate(new System.Uri("/BarcodeScanner;component/Scanner.xaml?dummy=" + Guid.NewGuid().ToString(), UriKind.Relative));
+ });
+ }
+
+ void root_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
+ {
+ if (!(e.Content is BarcodeScanner.Scanner)) return;
+
+ (Application.Current.RootVisual as PhoneApplicationFrame).Navigated -= root_Navigated;
+
+ BarcodeScanner.Scanner scanner = (BarcodeScanner.Scanner)e.Content;
+
+ if (scanner != null)
+ {
+ scanner.Completed += new EventHandler<BarcodeScanner.ScannerResult>(scanner_Completed);
+ }
+ }
+
+ void scanner_Completed(object sender, BarcodeScanner.ScannerResult e)
+ {
+ if (e.TaskResult == TaskResult.OK)
+ {
+ string result = String.Format("\"cancelled\":{0},\"text\":\"{1}\"", 0, e.ScanCode);
+ result = "{" + result + "}";
+ DispatchCommandResult(new PluginResult(PluginResult.Status.OK, result));
+ }
+ else
+ {
+ DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Failed to scan QR code"));
+ }
+ }
+
+ public void encode(string options)
+ {
+ DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Not implemented"));
+ }
+ }
+}
Binary file not shown.
@@ -0,0 +1,10 @@
+This is port of BarcodeScanner plugin for Windows Phone 7 platform.
+
+Usage:
+1) Reference both DLL by your project.
+2) Add BarcodeScanner.cs to your project
+3) Add barcodescanner.js to html
+
+Currently only 'scan' method is implemented.
+
+Have fun
Binary file not shown.
@@ -0,0 +1,79 @@
+/**
+ * PhoneGap/Cordova is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ *
+ * Copyright (c) Matt Kane 2010
+ * Copyright (c) 2010, IBM Corporation
+ */
+
+;(function(){
+
+//-------------------------------------------------------------------
+var BarcodeScanner = function() {
+}
+
+//-------------------------------------------------------------------
+BarcodeScanner.Encode = {
+ TEXT_TYPE: "TEXT_TYPE",
+ EMAIL_TYPE: "EMAIL_TYPE",
+ PHONE_TYPE: "PHONE_TYPE",
+ SMS_TYPE: "SMS_TYPE",
+ CONTACT_TYPE: "CONTACT_TYPE",
+ LOCATION_TYPE: "LOCATION_TYPE"
+}
+
+//-------------------------------------------------------------------
+BarcodeScanner.prototype.scan = function(success, fail, options) {
+ function successWrapper(result) {
+ result.cancelled = (result.cancelled == 1)
+ success.call(null, result)
+ }
+
+ if (!fail) { fail = function() {}}
+
+ if (typeof fail != "function") {
+ console.log("BarcodeScanner.scan failure: failure parameter not a function")
+ return
+ }
+
+ if (typeof success != "function") {
+ fail("success callback parameter must be a function")
+ return
+ }
+
+ if ( null == options )
+ options = []
+
+ return Cordova.exec(successWrapper, fail, "org.apache.cordova.barcodeScanner", "scan", options)
+}
+
+//-------------------------------------------------------------------
+BarcodeScanner.prototype.encode = function(type, data, success, fail, options) {
+ if (!fail) { fail = function() {}}
+
+ if (typeof fail != "function") {
+ console.log("BarcodeScanner.scan failure: failure parameter not a function")
+ return
+ }
+
+ if (typeof success != "function") {
+ fail("success callback parameter must be a function")
+ return
+ }
+
+ return Cordova.exec(success, fail, "org.apache.cordova.barcodeScanner", "encode", [{type: type, data: data, options: options}])
+}
+
+//-------------------------------------------------------------------
+Cordova.addConstructor(function() {
+ if (!window.plugins) window.plugins = {}
+
+ if (!window.plugins.barcodeScanner) {
+ window.plugins.barcodeScanner = new BarcodeScanner()
+ }
+ else {
+ console.log("Not installing barcodeScanner: window.plugins.barcodeScanner already exists")
+ }
+})
+
+})();
@@ -0,0 +1,82 @@
+<?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>10.0.20506</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{6B367A3F-E2A0-4425-B5DF-A91452C2F222}</ProjectGuid>
+ <ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>BarcodeScanner</RootNamespace>
+ <AssemblyName>BarcodeScanner</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <TargetFrameworkProfile>WindowsPhone71</TargetFrameworkProfile>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ValidateXaml>true</ValidateXaml>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>Bin\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Phone" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Net" />
+ <Reference Include="mscorlib.extensions" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Scanner.xaml.cs">
+ <DependentUpon>Scanner.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="PhotoCameraLuminanceSource.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="ScannerResult.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ZXing7_1Port\ZXingVer1_7.csproj">
+ <Project>{6431CF13-7A7B-4602-B96A-47CDA6F0B008}</Project>
+ <Name>ZXingVer1_7</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="Scanner.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <ProjectExtensions />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{C089C8C0-30E0-4E22-80C0-CE093F111A43}">
+ <SilverlightMobileCSProjectFlavor>
+ <FullDeploy>True</FullDeploy>
+ </SilverlightMobileCSProjectFlavor>
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project>
@@ -0,0 +1,34 @@
+using System;
+using com.google.zxing;
+
+namespace BarcodeScanner
+{
+ public class PhotoCameraLuminanceSource : LuminanceSource
+ {
+ public byte[] PreviewBufferY { get; private set; }
+
+ public PhotoCameraLuminanceSource(int width, int height)
+ : base(width, height)
+ {
+ PreviewBufferY = new byte[width * height];
+ }
+
+ public override sbyte[] Matrix
+ {
+ get { return (sbyte[])(Array)PreviewBufferY; }
+ }
+
+ public override sbyte[] getRow(int y, sbyte[] row)
+ {
+ if (row == null || row.Length < Width)
+ {
+ row = new sbyte[Width];
+ }
+
+ for (int i = 0; i < Height; i++)
+ row[i] = (sbyte)PreviewBufferY[i * Width + y];
+
+ return row;
+ }
+ }
+}
@@ -0,0 +1,37 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// 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("BarcodeScanner")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("BarcodeScanner")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[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("cd79b6da-fa53-4baa-82b4-72fb6d34ebc8")]
+
+// 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 Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: NeutralResourcesLanguageAttribute("en-US")]
@@ -0,0 +1,49 @@
+<phone:PhoneApplicationPage
+ x:Class="BarcodeScanner.Scanner"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ FontFamily="{StaticResource PhoneFontFamilyNormal}"
+ FontSize="{StaticResource PhoneFontSizeNormal}"
+ Foreground="{StaticResource PhoneForegroundBrush}"
+ SupportedOrientations="Portrait" Orientation="Portrait"
+ mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
+ shell:SystemTray.IsVisible="True">
+
+ <!--LayoutRoot is the root grid where all page content is placed-->
+ <Grid x:Name="LayoutRoot" Background="Transparent">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+
+ <Rectangle x:Name="_previewRect"
+ Margin="0"
+ Height="800"
+ Width="480"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Visibility="Visible">
+ <Rectangle.Fill>
+ <VideoBrush x:Name="_previewVideo">
+ <VideoBrush.RelativeTransform>
+ <CompositeTransform
+ x:Name="_previewTransform" CenterX=".5" CenterY=".5" />
+ </VideoBrush.RelativeTransform>
+ </VideoBrush>
+ </Rectangle.Fill>
+ </Rectangle>
+ <Button Height="100" Width="100" x:Name="_focusButton"
+ Click="_focusButton_Click" Margin="368,656,12,44"
+ FontSize="18" Background="Black" Foreground="White">
+ <TextBlock Text="Focus"/>
+ </Button>
+ <Border Height="400" Width="240" BorderBrush="Green" BorderThickness="3">
+ </Border>
+ </Grid>
+
+
+</phone:PhoneApplicationPage>
Oops, something went wrong.

0 comments on commit d1bdd99

Please sign in to comment.