Ejemplo n.º 1
0
        public MainPage()
        {
            this.InitializeComponent();

            canvasWidth = 1600;
            panelWidth = 500; // TODO: get these values from the actual full-screen resolution and the canvas:panel ratio.
            height = 900;

            Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
            Window.Current.CoreWindow.KeyUp += CoreWindow_KeyUp;
            Window.Current.CoreWindow.PointerPressed += CoreWindow_PointerPressed;
            Window.Current.CoreWindow.PointerReleased += CoreWindow_PointerReleased;
            Window.Current.CoreWindow.PointerMoved += CoreWindow_PointerMoved;
            Window.Current.CoreWindow.PointerWheelChanged += CoreWindow_PointerWheelChanged;
            Window.Current.SizeChanged += Current_SizeChanged;

            CanvasMinX = 0;
            CanvasMaxX = 1150;
            Picker = new ColorPicker(colorSlider1, colorSlider2, colorSlider3, panel1, panel2, panelExtra, hueRect, overlayRect, pickerCanvas,
                satRectBlack, satRectHue, valRectWhite, valRectHue,
                this, ((SolidColorBrush)pixelCanvas.Background).Color, ((SolidColorBrush)toolsPanel.Background).Color, Colors.LightGray,
                canvasWidth, height);
            PixDisplay = new PixelDisplay(pixelCanvas, debugText, Picker);

            // Set values now since PixDisplay isn't null.
            zoomSlider.Maximum = 10000;
            zoomSlider.Minimum = 100;
            zoomSlider.Value = 2000;
            zoomSlider.SmallChange = 100;
            zoomSlider.LargeChange = 100;
            zoomSlider.StepFrequency = 100;
            borderCheckBox.IsChecked = true;
            ChipIO.PixDisplay = PixDisplay;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new GridOverlay.
 /// </summary>
 public GridOverlay(PixelDisplay d)
 {
     Display = d;
     GridBrush = new SolidColorBrush(Colors.LightGray);
     GridBrushSelect = new SolidColorBrush(Colors.DimGray);
     SelectRect1 = new Rectangle() { Stroke = GridBrushSelect };
     SelectRect2 = new Rectangle() { Stroke = GridBrushSelect };
     BorderLines = new Line[4];
     for (int i = 0; i < BorderLines.Length; i++) BorderLines[i] = new Line() {
         Stroke = GridBrush,
         StrokeThickness = 4,
         StrokeEndLineCap = PenLineCap.Triangle };
 }