// Optionally, you can change the active scanning region. // The region specified below is the default, and lines up // with the default overlay. It is recommended to keep the // active region similar in size to the default region. // Additionally, the iPhone 3GS may not focus as well if // the region is too far away from center. // // In portrait mode only the top and bottom of this rectangle // is used. The x-position and width specified are ignored. 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); redlaserLogo.Transform = transform; setActiveRegionRect(); UIView.CommitAnimations(); // Animate! }
void setLandscapeLayout() { // Set landscape ParentPicker.Orientation = UIImageOrientation.Right; // Set the active scanning region for portrait mode ParentPicker.ActiveRegion = new RectangleF(100, 0, 120, 436); // Activate the new settings ParentPicker.ResumeScanning(); // Animate the UI changes CGAffineTransform transform = CGAffineTransform.MakeRotation(3.14159f / 2.0f); //this.View.Transform = transform; UIView.BeginAnimations("rotateToLandscape"); //UIView.SetAnimationDelegate = this; UIView.SetAnimationCurve(UIViewAnimationCurve.Linear); UIView.SetAnimationDuration(0.5f); redlaserLogo.Transform = transform; setActiveRegionRect(); UIView.CommitAnimations(); // Animate! }