Exemplo 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;
        }
Exemplo n.º 2
0
 public PaletteRect(Rectangle rOuter, Rectangle rInner, int i, ColorPicker p)
 {
     OuterRect = rOuter;
     InnerRect = rInner;
     _color = ((SolidColorBrush)OuterRect.Fill).Color;
     index = i;
     Picker = p;
     InnerRect.PointerPressed += InnerRect_Selected;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor for PixelDisplay. Requires a Canvas reference.
        /// </summary>
        public PixelDisplay(Canvas c, TextBlock t, ColorPicker p)
        {
            PixelCanvas = c;
            StatusText = t;
            Picker = p;
            PixelSize = 20;
            XCenter = 550;
            YCenter = 450;
            PreviousPoint = new Point() { x = -1, y = -1 };
            Point1 = new Point() { x = -1, y = -1 };
            Point2 = new Point() { x = -1, y = -1 };

            Tool = DrawTool.Pencil;
            Overlay = new GridOverlay(this);
            NewImage(16,16);
        }