Exemplo n.º 1
0
        // Private Methods /////////////////////////////////////////////////////////

        private void Init(Context context)
        {
            try
            {
                //LayoutInflater inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);
                LayoutInflater inflater = LayoutInflater.From(context);
                View           v        = inflater.Inflate(Resource.Layout.crop_image_view, this, true);
                if (v != null)
                {
                    mImageView = v.FindViewById <ImageView>(Resource.Id.ImageView_image);
                    if (mImageView != null)
                    {
                        SetImageResource(mImageResource);
                    }
                    mCropOverlayView = v.FindViewById <CropOverlayView>(Resource.Id.CropOverlayView);
                    if (mCropOverlayView != null)
                    {
                        mCropOverlayView.SetInitialAttributeValues(mGuidelines, mFixAspectRatio, mAspectRatioX, mAspectRatioY);
                    }
                }
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
Exemplo n.º 2
0
        /**
         * Determines if the cropper should focus on the center handle or the side
         * handles. If it is a small image, focus on the center handle so the user
         * can move it. If it is a large image, focus on the side handles so user
         * can grab them. Corresponds to the appearance of the
         * RuleOfThirdsGuidelines.
         *
         * @return true if it is small enough such that it should focus on the
         *         center; less than show_guidelines limit
         */

        private static bool focusCenter()
        {
            return(!CropOverlayView.ShowGuidelines());
        }