示例#1
0
        internal void SetEditType(ImageEditType type, ImageWidgetViewModel img = null)
        {
            if (this.EditType == type)
            {
                return;
            }

            this.EditType = type;
            this._img     = img;
            switch (type)
            {
            case ImageEditType.Slice:
                SliceLineVisible = true;
                CropToolsVisible = false;
                SliceType        = Module.SliceType.Cross;
                this._pageEditorViewModel.SetImageEditorFocus();
                break;

            case ImageEditType.Crop:
                SliceLineVisible = false;
                CropToolsVisible = true;
                this.InitialCropTools();
                this._pageEditorViewModel.SetImageEditorFocus();
                break;

            default:
                SliceLineVisible = false;
                CropToolsVisible = false;
                break;
            }
        }
示例#2
0
 public ImageEditorViewModel(PageEditorViewModel pageViewModel)
 {
     this._pageEditorViewModel = pageViewModel;
     this.EditType             = ImageEditType.None;
     SliceCrossCommand         = new DelegateCommand <object>(SliceCrossCommandHandler);
     SliceHorizontalCommand    = new DelegateCommand <object>(SliceHorizontalCommandHandler);
     SliceVerticalCommand      = new DelegateCommand <object>(SliceVerticalCommandHandler);
     CancelCommand             = new DelegateCommand <object>(CancelCommandHandler);
     CropCropCommand           = new DelegateCommand <object>(CropCropCommandHandler);
     CropCutCommand            = new DelegateCommand <object>(CropCutCommandHandler);
     CropCopyCommand           = new DelegateCommand <object>(CropCopyCommandHandler);
 }
示例#3
0
        internal void OnTouchEffectTouchAction(TouchActionEventArgs args, ImageEditType editType, SKColor color)
        {
            Point   pt    = args.Location;
            SKPoint point = new SKPoint((float)(CanvasSize.Width * pt.X / Width), (float)(CanvasSize.Height * pt.Y / Height));

            if (editType != ImageEditType.Paint)
            {
                OnTouchBitmapEffectAction(args, point);
            }
            else
            {
                OnTouchPathEffectAction(args, point, color);
            }

            previousTouchPoint = point;
        }