title: How to crop a large image to scan for barcode
body: <p>I'm developing a WP8 app to scan barcode using ZXing. It can scan the barcode if the image only contains the ITF barcode. However, it is not working if the barcode is inside a large image.</p>
  
  <p>So I guess that I have to crop the large image into smaller ones to apply the process of scanning. Am I correct?</p>
  
  <p>So, my question is:
  Is there some best practice to do that, or I need to apply some algorithm to pick portions of the large image randomly?</p>
  
  <p>Bellow is my code: </p>
  
  <pre><code>        StorageFolder folder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("Assets");
  
          BitmapImage bitmapImage = await GetBitmapImage(folder, "LargeImage.png");
  
          WriteableBitmap btmMap = new WriteableBitmap(bitmapImage);
          var rgb = new BitmapLuminanceSource(btmMap);
  
          var hybrid = new HybridBinarizer(rgb);
          BinaryBitmap binBitmap = new BinaryBitmap(hybrid);
  
          Dictionary&lt;DecodeHintType, object&gt; zxingHints
              = new Dictionary&lt;DecodeHintType, object&gt;() { { DecodeHintType.TRY_HARDER, true } };
  
          Reader reader = new ZXing.OneD.MultiFormatOneDReader(zxingHints);
  
          try
          {
              Result result = reader.decode(binBitmap);
              if (result != null)
              {
                  this.resultText = result.Text;
              }
          }
          catch (Exception ex)
          {
              this.resultText = ex.Message;
          }
  </code></pre>