Пример #1
0
        void BtnTakePic_TouchUpInside(object sender, EventArgs e)
        {
            UICameraController cameraController = parentController.Storyboard.InstantiateViewController("UICameraController") as UICameraController;

            cameraController.ClearCamearaView();
            cameraController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            cameraController.picture = this.UpdateCollectionImageView;
            if (cameraController.MediaLst != null)
            {
                cameraController.MediaLst.Clear();
            }

            if (MediaLst != null && MediaLst.Count > 0)
            {
                MediaLst.Clear();
            }

            foreach (UIImage image in imagesList)
            {
                UIImageView imageView = new UIImageView();
                imageView.Image = image;
                MediaLst.Add(imageView);
            }
            cameraController.MediaLst = MediaLst;
            IsPunchValueChanged       = true;
            parentController.PresentViewController(cameraController, false, null);
        }
Пример #2
0
        /// <summary>
        /// Guided photo take picture button touch up inside.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        void guidedPhotoTkPicBtn_TouchUpInside(object sender, EventArgs e)
        {
            try {
                ResetTheCameraImageView();
                if (parentController != null)
                {
                    UICameraController cameraController = parentController.Storyboard.InstantiateViewController("UICameraController") as UICameraController;
                    cameraController.ClearCamearaView();
                    cameraController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
                    cameraController.picture = this.UpdateCollectionImageView;
                    if (cameraController.MediaLst != null)
                    {
                        foreach (var view in cameraController.MediaLst)
                        {
                            view.RemoveFromSuperview();
                        }
                        cameraController.MediaLst.Clear();
                    }
                    if (cameraController.imagesList != null)
                    {
                        cameraController.imagesList.Clear();
                    }

                    if (this.ImageLst == null)
                    {
                        this.ImageLst = new List <UIImage> ();
                    }

                    List <UIImageView> MediaLst = new List <UIImageView> ();
                    if (this.ImageLst.Count > 0)
                    {
                        foreach (UIImage image in this.ImageLst)
                        {
                            UIImageView imageView = new UIImageView();
                            imageView.Image = image;
                            MediaLst.Add(imageView);
                        }
                    }
                    cameraController.MediaLst = MediaLst;
                    parentController.PresentViewController(cameraController, false, null);
                }
            } catch (Exception ex) {
                Debug.WriteLine("Exception Occured in BtnTakePic_TouchUpInside method due to " + ex.Message);
            }
        }
Пример #3
0
        public List <UIImageView> RestructureImages(List <UIImage> scrollImages, InspectionViewController parentController)
        {
            try
            {
                nfloat             h       = 100.0f;
                nfloat             w       = 100.0f;
                nfloat             padding = 10.0f;
                List <UIImageView> scrollImageCollection = new List <UIImageView> ();
                for (int i = 0; i < scrollImages.Count; i++)
                {
                    UIImageView imageView = new UIImageView();
                    imageView.Frame = new CGRect(padding * (i + 1) + (i * w), 0, w, h);
                    imageView.Image = scrollImages [i];

                    Action tapAction = new Action(
                        delegate {
                        //imageView = HighlightSelectedImage (imageView);
                        ImagePeviewViewController imagePreviewController = parentController.Storyboard.InstantiateViewController("ImagePeviewViewController") as ImagePeviewViewController;
                        imagePreviewController.ModalPresentationStyle    = UIModalPresentationStyle.FullScreen;
                        imagePreviewController.previewImage = imageView;
                        parentController.PresentViewController(imagePreviewController, false, null);
                    });

                    UITapGestureRecognizer tap = new UITapGestureRecognizer();
                    tap.AddTarget(tapAction);
                    imageView.AddGestureRecognizer(tap);
                    imageView.UserInteractionEnabled = true;

                    scrollImageCollection.Add(imageView);
                }

                return(scrollImageCollection);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception Occured in RestructureImages method due to " + ex.Message);
                return(new List <UIImageView> ());
            }
        }