Beispiel #1
0
        public void onMouseMove(object sender, MouseEventArgs e)
        {
            if (graphics != null && bMouseDown)
            {
                if (e.Button == MouseButtons.Left)
                {
                    pNew = e.Location;

                    if (settings.getTabletPressure() == -1)
                    {
                        graphics.DrawLine(eraser, pOld, pNew);
                    }
                    else if (settings.getTabletPressure() >= 0)
                    {
                        eraser.Width = (float)Math.Pow(2.0, SharedSettings.MapDouble(0, SharedSettings.iMaxTabletPressure, 0.0, 6.0, SharedSettings.iTabletPressure));
                        graphics.DrawLine(eraser, pOld, pNew);
                    }
                    pOld = pNew;
                }
            }
        }
Beispiel #2
0
        public void onMouseMove(object sender, MouseEventArgs e)
        {
            if (graphics != null && bMouseDown)
            {
                pNew = e.Location;
                if (settings.getTabletPressure() > 0)
                {
                    double pressure = Math.Pow(2.0, SharedSettings.MapDouble(0, SharedSettings.iMaxTabletPressure, 0.0, 6.0, SharedSettings.iTabletPressure));
                    Console.WriteLine(pressure);

                    if (pressure >= 0)
                    {
                        pen.Width = (float)pressure;
                    }
                }
                else
                {
                    pen.Width = settings.getBrushSize() / 2;
                }

                switch (e.Button)
                {
                // TODO: Add tablet pressure back in...
                case MouseButtons.Left:
                    pen.Color = primaryColor;
                    graphics.DrawLine(pen, pOld, pNew);
                    break;

                case MouseButtons.Right:
                    pen.Color = secondaryColor;
                    graphics.DrawLine(pen, pOld, pNew);
                    break;

                default:
                    break;
                }
                pOld = pNew;
            }
        }