Beispiel #1
0
 public IBBrush()
 {
     for (int i = 0; i < histCoord.Length; i++)
     {
         histCoord[i] = new IBCoord();
     }
 }
Beispiel #2
0
        public override void Draw(IBCoord coord)
        {
            base.Draw(coord);

            double dist = IBCoord.GetDistance(histCoord[0], coord);

            if (dist < 0.1)
            {
                return;
            }

            if (trgLayer == null)
            {
                return;
            }

            switch (trgLayer.LayerType)
            {
            case ImageTypes.LineDrawing:
                EraseLineDrawingImage(trgLayer, Size);
                break;

            default:
                return;
            }
        }
Beispiel #3
0
        public override bool Set(IBCanvasControl canvas, IBProjectElement trg, IBCoord coord)
        {
            if (base.Set(canvas, trg, coord))
            {
                return(false);
            }

            return(true);
        }
Beispiel #4
0
        public override bool Set(IBCanvasControl canvas, IBProjectElement trg, IBCoord coord)
        {
            if (!base.Set(canvas, trg, coord))
            {
                return(false);
            }

            actionSummary = "Eraser Tool / " + trg.Name;

            return(true);
        }
Beispiel #5
0
        public virtual void Draw(IBCoord coord)
        {
            if (!drawing)
            {
                return;
            }

            count = 0;

            double x = coord.x, y = coord.y;

            if (AllowCorrection)
            {
                for (int i = 0; i < 2; i++)
                {
                    x += histCoord[i].x * (0.75 - i * 0.5);
                    y += histCoord[i].y * (0.75 - i * 0.5);
                }

                curCoord.x = x / 2.0;
                curCoord.y = y / 2.0;
            }
            else
            {
                curCoord.x = x;
                curCoord.y = y;
            }

            for (int i = histCoord.Length - 1; i > 0; i--)
            {
                histCoord[i].x = histCoord[i - 1].x;
                histCoord[i].y = histCoord[i - 1].y;
            }

            for (int i = histPressure.Length - 1; i > 0; i--)
            {
                histPressure[i] = histPressure[i - 1];
            }

            histCoord[0].x  = curCoord.x;
            histCoord[0].y  = curCoord.y;
            histPressure[0] = currentCanvas.StylusPressure;
            if (WintabUtility.Pressure != 0)
            {
                histPressure[0] = WintabUtility.Pressure;
            }
            curPressure = histPressure[0];
        }
        public override bool Set(IBCanvasControl canvas, IBProjectElement trg, IBCoord coord)
        {
            if (!base.Set(canvas, trg, coord))
            {
                return(false);
            }

            trgCell = trgImage as CellSource;
            if (trgCell == null)
            {
                return(false);
            }
            if (trgLayer == null)
            {
                return(false);
            }

            actionSummary = "Selection Tool / " + trg.Name;
            DynamicRender.OverrayColor[0] = 0;
            DynamicRender.OverrayColor[1] = 0;
            DynamicRender.OverrayColor[2] = 0;

            if (trgCell.PixcelSelectedArea != null)
            {
                if (trgCell.IsPixcelSelecting)
                {
                    trgCell.IsPixcelSelecting            = false;
                    SelectersLayerMode                   = false;
                    trgCell.PixcelSelectedArea.imageData = null;
                    trgCell.PixcelSelectedArea           = null;
                    IBCanvasControl.RefreshAll();
                }
            }

            trgCell.PixcelSelectedArea = new PixcelImage(
                (int)trgLayer.imageData.actualSize.Width,
                (int)trgLayer.imageData.actualSize.Height,
                (int)trgLayer.Rect.OffsetX,
                (int)trgLayer.Rect.OffsetY);
            trgCell.PixcelSelectedArea.IsNotSelectersLayer = false;

            trgCell.PixcelSelectedArea.imageData.SetDrawingMode();

            start.x = histCoord[0].x;
            start.y = histCoord[0].y;

            return(true);
        }
        public override void Draw(IBCoord coord)
        {
            base.Draw(coord);

            if (trgCell == null)
            {
                return;
            }

            trgCell.IsPixcelSelecting = true;
            SelectersLayerMode        = true;

            double dist = IBCoord.GetDistance(histCoord[0], coord);

            if (dist < 0.1)
            {
                return;
            }

            Draw(trgCell.PixcelSelectedArea);
        }
Beispiel #8
0
        public virtual bool Set(IBCanvasControl canvas, IBProjectElement trg, IBCoord coord)
        {
            currentCanvas = canvas;
            trgImage      = trg;
            trgLayer      = GetSelectedLayer();
            if (trgImage == null || trgLayer == null || !trgLayer.imageData.CanDraw)
            {
                return(false);
            }

            if (!drawing)
            {
                beforeDataStride = (int)trgLayer.imageData.actualSize.Width * 4;
                RecordBeforeData();
            }

            penUp   = false;
            drawing = true;
            count   = 0;

            for (int i = 0; i < histPressure.Length; i++)
            {
                histPressure[i] = currentCanvas.StylusPressure;
                if (WintabUtility.Pressure != 0)
                {
                    histPressure[i] = WintabUtility.Pressure;
                }
            }

            foreach (IBCoord c in histCoord)
            {
                c.x = coord.x;
                c.y = coord.y;
            }

            return(true);
        }
Beispiel #9
0
 public override void Draw(IBCoord coord)
 {
     //base.Draw(coord);
 }