I am using RedLaser and MonoTouch to develop a simple barcode scanning App.
I have used the Sample code provided and I am able to deploy my code to the iphone and it scans Barcodes fine.
However, the camera view is not showing. The Active region is blank. Please see the image below

When I run the sample it works fine. I am guessing it is something to do with wiring the Views and the Controllers
my Code is like this:
public partial class BarcodeScanModalController : CameraOverlayViewController
{
CAShapeLayer Rectanglelayer;
bool IsSilent;
public BarcodeScanModalController (IntPtr handle) : base (handle)
{
}
public BarcodeScanModalController ()
{
}
internal void BeepOrVibrate ()
{
if (!IsSilent)
{
SystemSound.FromFile ("Sounds/beep.wav").PlayAlertSound ();
}
}
void setPortraitLayout ()
{
// Set portrait
ParentPicker.Orientation = UIImageOrientation.Up;
// Set the active scanning region for portrait mode
ParentPicker.ActiveRegion = new RectangleF (0, 100, 320, 250);
// Activate the new settings
ParentPicker.ResumeScanning ();
// Animate the UI changes
CGAffineTransform transform = CGAffineTransform.MakeRotation (0);
//this.View.Transform = transform;
UIView.BeginAnimations ("rotateToPortrait");
//UIView.SetAnimationDelegate = this;
UIView.SetAnimationCurve (UIViewAnimationCurve.Linear);
UIView.SetAnimationDuration (0.5f);
setActiveRegionRect ();
UIView.CommitAnimations (); // Animate!
}
CGPath newPathInRect (RectangleF rect)
{
CGPath path = new CGPath ();
path.AddRect (rect);
return path;
}
void setActiveRegionRect ()
{
Rectanglelayer.Frame = new RectangleF ( ParentPicker.ActiveRegion.X,
ParentPicker.ActiveRegion.Y,
ParentPicker.ActiveRegion.Width,
ParentPicker.ActiveRegion.Height
);
CGPath path = newPathInRect (Rectanglelayer.Bounds);
Rectanglelayer.Path = path;
Rectanglelayer.SetNeedsLayout ();
}
Then I use this OverlayController like this:
public void ScanItemsButtonPressed (object sender, EventArgs e)
{
if (overlayController == null)
{
overlayController = new BarcodeScanModalController { ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal};
}
if (overlayController.ParentPicker == null)
{
BarcodePickerController picker = new BarcodePickerController ();
picker.Overlay = overlayController;
picker.Delegate = new BarcodePickerDelegate (this);
picker.Orientation = UIImageOrientation.Up;
}
overlayController.ParentPicker.ScanUPCE = true;
overlayController.ParentPicker.ScanEAN8 = true;
overlayController.ParentPicker.ScanEAN13 = true;
// overlayController.ParentPicker.ScanSTICKY = false;
overlayController.ParentPicker.ScanQRCODE = false;
overlayController.ParentPicker.ScanCODE128 = true;
overlayController.ParentPicker.ScanCODE39 = true;
overlayController.ParentPicker.ScanITF = true;
// Data matrix decoding does not work very well so it is disabled for now
overlayController.ParentPicker.ScanDATAMATRIX = false;
// hide the status bar
UIApplication.SharedApplication.StatusBarHidden = true;
overlayController.Done += delegate {
DismissModalViewControllerAnimated (true);
} ;
this.PresentModalViewController (overlayController.ParentPicker, true);
}
I am using MonoTouch 6.0.8, RedLaser 3.4.0, and XCode 4.5.2
Any help would be highly appreciated. Thanks
This appeared to be rather a simple issue.
The background Color and the ActiveRegion FillColor was a Full Color (not transparent), so it comes on top of the Camera View. I was able to resolve the issue by Setting the background of the Scanning View to No Color (Default), and setting the ActiveRegion to something transparent as below.