PhotoViewerTest.Droid.PhotoViewDroidAttacher.GetImageView C# (CSharp) 메소드

GetImageView() 공개 메소드

public GetImageView ( ) : ImageView
리턴 ImageView
        public ImageView GetImageView()
        {
            ImageView imageView = null;

            if (null != mImageView) {
                imageView = (ImageView)mImageView.Get();
            }

            // If we don't have an ImageView, call cleanup()
            if (null == imageView) {
                Cleanup();
                Log.Info(LOG_TAG,
                    "ImageView no longer exists. You should not use this PhotoViewAttacher any more.");
            }

            return imageView;
        }

Usage Example

예제 #1
0
        public bool OnSingleTapConfirmed(Android.Views.MotionEvent e)
        {
            if (this.photoViewAttacher == null)
            {
                return(false);
            }
            ImageView imageView = photoViewAttacher.GetImageView();

            if (null != photoViewAttacher.GetOnPhotoTapListener())
            {
                RectF displayRect = photoViewAttacher.GetDisplayRect();
                if (null != displayRect)
                {
                    float x = e.GetX(), y = e.GetY();

                    if (displayRect.Contains(x, y))
                    {
                        float xResult = (x - displayRect.Left)
                                        / displayRect.Width();
                        float yResult = (y - displayRect.Top)
                                        / displayRect.Height();

                        photoViewAttacher.GetOnPhotoTapListener().OnPhotoTap(imageView, xResult, yResult);
                        return(true);
                    }
                }
            }
            if (null != photoViewAttacher.GetOnViewTapListener())
            {
                photoViewAttacher.GetOnViewTapListener().OnViewTap(imageView, e.GetX(), e.GetY());
            }

            return(false);
        }
All Usage Examples Of PhotoViewerTest.Droid.PhotoViewDroidAttacher::GetImageView