Ejemplo n.º 1
0
        private async void HomeButton_Tapped(object sender, TappedRoutedEventArgs e)
        {
            //如果操作次数大于2,显示消息框,否则直接退回
            //   if (App.Model.Refresh>2)
            await HomeContentDialog.ShowAsync();

            //    else
            //        Frame.GoBack();
        }
Ejemplo n.º 2
0
        //康戳键
        private void KeyCtrl(VirtualKey value)
        {
            switch (value)
            {
            //Undo:撤销
            case VirtualKey.Z: if (App.Model.isUndo)
                {
                    Undo();
                }
                break;

            case VirtualKey.Y: if (App.Model.isRedo)
                {
                    Redo();
                }
                break;

            case VirtualKey.S:  HomeContentDialog.ShowAsync();  break;

            //Mask:选区
            case VirtualKey.X: 修图.Control.MaskButton.Cut(); break;

            case VirtualKey.C: 修图.Control.MaskButton.Copy(); break;

            case VirtualKey.V:
                DataPackageView dataPackageView = Clipboard.GetContent();
                if (dataPackageView.Contains(StandardDataFormats.Bitmap))
                {
                    IRandomAccessStreamReference imageReceived = null;
                    imageReceived = dataPackageView.GetBitmapAsync().AsTask().Result;
                    if (imageReceived != null)
                    {
                        using (IRandomAccessStream stream = imageReceived.OpenReadAsync().AsTask().Result)
                        {
                            App.Model.SecondCanvasBitmap = CanvasVirtualBitmap.LoadAsync(App.Model.VirtualControl, stream).AsTask().Result;
                            App.InitializeOther();
                            LayerControl_Layers();
                        }
                    }
                }
                else if (App.Model.isClipboard == true)
                {
                    App.InitializeEffect();
                    MaskButton_Mask(102);
                }

                break;

            case VirtualKey.Delete: 修图.Control.MaskButton.Clear(); break;

            case VirtualKey.E: 修图.Control.MaskButton.Extract(); break;

            case VirtualKey.M: 修图.Control.MaskButton.Merge(); break;

            case VirtualKey.A: 修图.Control.MaskButton.All(); break;

            case VirtualKey.D: 修图.Control.MaskButton.Deselect(); break;

            case VirtualKey.P: 修图.Control.MaskButton.Pixel(); break;

            case VirtualKey.I: 修图.Control.MaskButton.Invert(); break;

            case VirtualKey.F: MaskButton_Mask(110); break;

            case VirtualKey.T: MaskButton_Mask(111); break;
            }
        }