/** * Set the options of the crop image view to the given values. */ public void setCropImageViewOptions(CropImageViewOptions options) { mCropImageView.SetScaleType(options.scaleType); mCropImageView.SetCropShape(options.cropShape); mCropImageView.SetGuidelines(options.guidelines); mCropImageView.SetAspectRatio((int)options.aspectRatio.First, (int)options.aspectRatio.Second); mCropImageView.SetFixedAspectRatio(options.fixAspectRatio); mCropImageView.ShowCropOverlay = options.showCropOverlay; mCropImageView.ShowProgressBar = options.showProgressBar; mCropImageView.AutoZoomEnabled = options.autoZoomEnabled; mCropImageView.MaxZoom = options.maxZoomLevel; }
public void SetCropImageViewOptions(CropImageViewOptions options) { mCropImageView.SetScaleType(options.scaleType); mCropImageView.SetCropShape(options.cropShape); mCropImageView.SetGuidelines(options.guidelines); mCropImageView.SetAspectRatio(options.aspectRatio.Item1, options.aspectRatio.Item2); mCropImageView.SetFixedAspectRatio(options.fixAspectRatio); mCropImageView.SetMultiTouchEnabled(options.multitouch); mCropImageView.ShowCropOverlay = (options.showCropOverlay); mCropImageView.ShowProgressBar = (options.showProgressBar); mCropImageView.AutoZoomEnabled = (options.autoZoomEnabled); mCropImageView.MaxZoom = (options.maxZoomLevel); mCropImageView.FlippedHorizontally = (options.flipHorizontally); mCropImageView.FlippedVertically = (options.flipVertically); }
public void updateCurrentCropViewOptions() { CropImageViewOptions options = new CropImageViewOptions(); options.scaleType = mCropImageView.GetScaleType(); options.cropShape = mCropImageView.GetCropShape(); options.guidelines = mCropImageView.GetGuidelines(); options.aspectRatio = mCropImageView.AspectRatio; options.fixAspectRatio = mCropImageView.IsFixAspectRatio; options.showCropOverlay = mCropImageView.ShowCropOverlay; options.showProgressBar = mCropImageView.ShowProgressBar; options.autoZoomEnabled = mCropImageView.AutoZoomEnabled; options.maxZoomLevel = mCropImageView.MaxZoom; ((MainActivity)Activity).setCurrentOptions(options); }
public void UpdateCurrentCropViewOptions() { CropImageViewOptions options = new CropImageViewOptions(); options.scaleType = mCropImageView.GetScaleType(); options.cropShape = mCropImageView.GetCropShape(); options.guidelines = mCropImageView.GetGuidelines(); options.aspectRatio = new System.Tuple <int, int>((int)mCropImageView.AspectRatio.First, (int)mCropImageView.AspectRatio.Second); options.fixAspectRatio = mCropImageView.IsFixAspectRatio; options.showCropOverlay = mCropImageView.ShowCropOverlay; options.showProgressBar = mCropImageView.ShowProgressBar; options.autoZoomEnabled = mCropImageView.AutoZoomEnabled; options.maxZoomLevel = mCropImageView.MaxZoom; options.flipHorizontally = mCropImageView.FlippedHorizontally; options.flipVertically = mCropImageView.FlippedVertically; ((MainActivity)Activity).SetCurrentOptions(options); }
private void updateDrawerTogglesByOptions(CropImageViewOptions options) { ((TextView)FindViewById(Resource.Id.drawer_option_toggle_scale)).Text = Resources.GetString(Resource.String.drawer_option_toggle_scale, options.scaleType.Name()); ((TextView)FindViewById(Resource.Id.drawer_option_toggle_shape)).Text = Resources.GetString(Resource.String.drawer_option_toggle_shape, options.cropShape.Name()); ((TextView)FindViewById(Resource.Id.drawer_option_toggle_guidelines)).Text = Resources.GetString(Resource.String.drawer_option_toggle_guidelines, options.guidelines.Name()); ((TextView)FindViewById(Resource.Id.drawer_option_toggle_show_overlay)).Text = Resources.GetString(Resource.String.drawer_option_toggle_show_overlay, options.showCropOverlay.ToString()); ((TextView)FindViewById(Resource.Id.drawer_option_toggle_show_progress_bar)).Text = Resources.GetString(Resource.String.drawer_option_toggle_show_progress_bar, options.showProgressBar.ToString()); var aspectRatio = "FREE"; if (options.fixAspectRatio) { aspectRatio = options.aspectRatio.First + ":" + options.aspectRatio.Second; } ((TextView)FindViewById(Resource.Id.drawer_option_toggle_aspect_ratio)).Text = Resources.GetString(Resource.String.drawer_option_toggle_aspect_ratio, aspectRatio); ((TextView)FindViewById(Resource.Id.drawer_option_toggle_auto_zoom)).Text = Resources.GetString(Resource.String.drawer_option_toggle_auto_zoom, options.autoZoomEnabled ? "Enabled" : "Disabled"); ((TextView)FindViewById(Resource.Id.drawer_option_toggle_max_zoom)).Text = Resources.GetString(Resource.String.drawer_option_toggle_max_zoom, options.maxZoomLevel); }
public void setCurrentOptions(CropImageViewOptions options) { mCropImageViewOptions = options; updateDrawerTogglesByOptions(options); }