protected override void OnSaveSettings() { base.OnSaveSettings(); CropDecoratorSettings settings = new CropDecoratorSettings(Settings); if (imageCropControl.Enabled) { settings.CropRectangle = RectangleHelper.UndoRotateFlip(imageCropControl.Bitmap.Size, imageCropControl.CropRectangle, EditorContext.ImageRotation); settings.AspectRatioId = ((AspectRatioItem)(cbAspectRatio.SelectedItem ?? cbAspectRatio.Items[1])).Id; settings.AspectRatio = imageCropControl.AspectRatio; } else { // indicates that crop should be removed settings.CropRectangle = null; settings.AspectRatioId = null; settings.AspectRatio = null; } }