public PixelCollection Draw(PixelCollection pixels, IList <Point> drawingPoints, DrawingItemProperties properties) { for (int i = 0; i < drawingPoints.Count - 1; i++) { pixels = _lineTool.BresenhamLine(pixels, drawingPoints[i], drawingPoints[i + 1], properties.Color); } return(pixels); }
public PixelCollection Draw(PixelCollection pixels, IList <Point> drawingPoints, DrawingItemProperties properties) { Point center = PointCalculator.GetCenter(drawingPoints.First(), drawingPoints.Last()); Point topCenter = new Point(center.X, drawingPoints.First().Y); Point bottomCenter = new Point(center.X, drawingPoints.Last().Y); double radius = PointCalculator.GetLenght(topCenter, bottomCenter) / 2; return(BresenhamCircle(pixels, center, radius, properties.Color)); }
public BitmapSource Draw(BitmapSource currentBitmap, ToolType toolType, IList <Point> drawingPoints, DrawingItemProperties properties) { IPainterTool painterTool = _toolFactory.Create(toolType); if (_pixelCollection == null) { _pixelCollection = BitmapConverter.ToPixelCollection(currentBitmap); } var newPixels = painterTool.Draw(_pixelCollection, drawingPoints, properties); // TODO Add to undo operations here _pixelCollection = newPixels; return(BitmapConverter.ToBitmap(newPixels)); }
public PixelCollection Draw(PixelCollection pixels, IList <Point> drawingPoints, DrawingItemProperties properties) { return(BresenhamLine(pixels, drawingPoints.First(), drawingPoints.Last(), properties.Color)); }
public PixelCollection Draw(PixelCollection pixels, IList <Point> drawingPoints, DrawingItemProperties properties) { var fillPixel = pixels.GetPixel(drawingPoints.First()); FloodFill(pixels, fillPixel, fillPixel.Color, properties.Color); return(pixels); }
public PixelCollection Draw(PixelCollection pixels, IList <Point> drawingPoints, DrawingItemProperties properties) { return(_pencilTool.Draw(pixels, drawingPoints, new DrawingItemProperties(Colors.White))); }