Example #1
0
 public override void DrawSelectPoints(FastPixel.FastPixel fp)
 {
     if (_dragPoints != null)
     {
         foreach (PreviewDoublePoint point in _dragPoints)
         {
             if (point?.PointType == PreviewPoint.PointTypes.Size)
             {
                 int x = Convert.ToInt32(point.X - (double)SelectPointSize / 2);
                 int y = Convert.ToInt32(point.Y - (double)SelectPointSize / 2);
                 fp.DrawRectangle(
                     new Rectangle(x, y, SelectPointSize, SelectPointSize),
                     Color.White);
             }
             else
             {
                 if (point?.PointType == PreviewPoint.PointTypes.Rotate)
                 {
                     int x = Convert.ToInt32(point.X - (double)SelectPointSize / 2);
                     int y = Convert.ToInt32(point.Y - (double)SelectPointSize / 2);
                     fp.DrawCircle(
                         new Rectangle(x, y, SelectPointSize, SelectPointSize),
                         Color.White);
                 }
             }
         }
     }
 }
Example #2
0
        public void Draw(FastPixel.FastPixel fp, IIntentStates states, double zoomLevel)
        {
            if (_isDiscreteColored)
            {
                int       col      = 1;
                int       zoomedX  = (int)(Bounds.X * zoomLevel);
                Rectangle drawRect = new Rectangle(zoomedX, (int)(Bounds.Y * zoomLevel), Bounds.Width, Bounds.Height);
                // Get states for each color
                List <Color> colors = _discreteHandler.GetAlphaAffectedColor(states);
                foreach (Color c in colors)
                {
                    if (c != Color.Transparent && c.A > byte.MinValue)
                    {
                        fp.DrawCircle(drawRect, c);

                        if (col % 2 == 0)
                        {
                            drawRect.Y += PixelSize;
                            drawRect.X  = zoomedX;
                        }
                        else
                        {
                            drawRect.X = zoomedX + PixelSize;
                        }

                        col++;
                    }
                }
            }
            else
            {
                var state = states.FirstOrDefault();
                if (state != null)
                {
                    Color intentColor = _fullColorHandler.GetFullColor(state);
                    if (intentColor.A > 0)
                    {
                        Rectangle drawRect = zoomLevel != 1?new Rectangle((int)(Bounds.X * zoomLevel), (int)(Bounds.Y * zoomLevel), Bounds.Width, Bounds.Height):Bounds;
                        fp.DrawCircle(drawRect, intentColor);
                    }
                }
            }
        }
Example #3
0
        public void Draw(FastPixel.FastPixel fp, IIntentStates states)
        {
            if (_isDiscreteColored)
            {
                int       col      = 1;
                Rectangle drawRect = new Rectangle(drawArea.X, drawArea.Y, drawArea.Width, drawArea.Height);
                // Get states for each color
                List <Color> colors = _discreteHandler.GetAlphaAffectedColor(states);
                foreach (Color c in colors)
                {
                    if (c != Color.Transparent && c.A > byte.MinValue)
                    {
                        fp.DrawCircle(drawRect, c);

                        if (col % 2 == 0)
                        {
                            drawRect.Y += PixelSize;
                            drawRect.X  = drawArea.X;
                        }
                        else
                        {
                            drawRect.X = drawArea.X + PixelSize;
                        }

                        col++;
                    }
                }
            }
            else
            {
                var state = states.FirstOrDefault();
                if (state != null)
                {
                    Color intentColor = _fullColorHandler.GetFullColor(state);
                    if (intentColor.A > 0)
                    {
                        fp.DrawCircle(drawArea, intentColor);
                    }
                }
            }
        }
        public void Draw(FastPixel.FastPixel fp, IIntentStates states)
        {
            if (_isDiscreteColored)
            {
                int       col      = 1;
                Rectangle drawRect = new Rectangle(drawArea.X, drawArea.Y, drawArea.Width, drawArea.Height);
                // Get states for each color
                IEnumerable <Color> colors = IntentHelpers.GetAlphaAffectedDiscreteColorsForIntents(states);
                foreach (Color c in colors)
                {
                    if (c != Color.Transparent && c.A > byte.MinValue)
                    {
                        fp.DrawCircle(drawRect, c);

                        if (col % 2 == 0)
                        {
                            drawRect.Y += PixelSize;
                            drawRect.X  = drawArea.X;
                        }
                        else
                        {
                            drawRect.X = drawArea.X + PixelSize;
                        }

                        col++;
                    }
                }
            }
            else
            {
                Color intentColor = IntentHelpers.GetAlphaRGBMaxColorForIntents(states);
                if (intentColor != Color.Transparent && intentColor.A > 0)
                {
                    fp.DrawCircle(drawArea, intentColor);
                }
            }
        }
Example #5
0
 public void Draw(FastPixel.FastPixel fp, Color newColor)
 {
     fp.DrawCircle(drawArea, newColor);
 }
Example #6
0
 public void Draw(FastPixel.FastPixel fp, Color newColor)
 {
     fp.DrawCircle(Bounds, newColor);
 }