Beispiel #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);
        }
Beispiel #2
0
        public void ClearCamearaView()
        {
            if (cameraImageView != null)
            {
                cameraImageView.Image = null;
            }
            if (imagesList != null)
            {
                imagesList.Clear();
            }

            if (MediaLst != null)
            {
                foreach (var view in MediaLst)
                {
                    view.RemoveFromSuperview();
                }
                MediaLst.Clear();
            }

            if (imageCollectionView != null)
            {
                foreach (var view in imageCollectionView.Subviews)
                {
                    if (view is UIImageView)
                    {
                        (view as UIImageView).Image = null;
                    }
                    view.RemoveFromSuperview();
                }
                if (imageCollectionView.Source != null)
                {
                    imageCollectionView.Source.Dispose();
                    imageCollectionView.Source = null;
                }
            }

            GC.Collect();
        }