예제 #1
0
 /// <summary>
 /// Flood fills the image in the shape of the provided polygon with the specified brush.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="brush">The brush.</param>
 /// <param name="paths">The paths.</param>
 /// <returns>The <see cref="Image{TPixel}"/>.</returns>
 public static IImageProcessingContext Fill(
     this IImageProcessingContext source,
     IBrush brush,
     IPathCollection paths) =>
 source.Fill(source.GetShapeGraphicsOptions(), brush, paths);
예제 #2
0
 private void SetGraphicsOptions(IImageProcessingContext context)
 {
     context.GetGraphicsOptions().Antialias = true;
     context.GetShapeGraphicsOptions().GraphicsOptions.Antialias = true;
 }
예제 #3
0
 Draw(this IImageProcessingContext source, IPen pen, IPathCollection paths) =>
 source.Draw(source.GetShapeGraphicsOptions(), pen, paths);
예제 #4
0
 /// <summary>
 /// Draws the provided Points as a closed Linear Polygon with the provided Pen.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="pen">The pen.</param>
 /// <param name="points">The points.</param>
 /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns>
 public static IImageProcessingContext DrawPolygon(
     this IImageProcessingContext source,
     IPen pen,
     params PointF[] points) =>
 source.Draw(source.GetShapeGraphicsOptions(), pen, new Polygon(new LinearLineSegment(points)));
예제 #5
0
 /// <summary>
 /// Flood fills the image with in the region with the specified brush.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="brush">The brush.</param>
 /// <param name="region">The region.</param>
 /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns>
 public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, Region region) =>
 source.Fill(source.GetShapeGraphicsOptions(), brush, region);
 /// <summary>
 /// Draws the outline of the rectangle with the provided pen.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="pen">The pen.</param>
 /// <param name="shape">The shape.</param>
 /// <returns>The <see cref="Image{TPixel}"/>.</returns>
 public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, RectangleF shape) =>
 source.Draw(source.GetShapeGraphicsOptions(), pen, shape);
예제 #7
0
 /// <summary>
 /// Draws the outline of the polygon with the provided pen.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="pen">The pen.</param>
 /// <param name="path">The path.</param>
 /// <returns>The <see cref="Image{TPixel}"/>.</returns>
 public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, IPath path) =>
 source.Draw(source.GetShapeGraphicsOptions(), pen, path);
예제 #8
0
 /// <summary>
 /// Flood fills the image in the shape of the provided polygon with the specified brush.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="brush">The brush.</param>
 /// <param name="path">The path.</param>
 /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns>
 public static IImageProcessingContext Fill(
     this IImageProcessingContext source,
     IBrush brush,
     Action <PathBuilder> path) =>
 source.Fill(source.GetShapeGraphicsOptions(), brush, path);
예제 #9
0
 /// <summary>
 /// Flood fills the image in the shape of the provided polygon with the specified brush without any blending.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="brush">The brush.</param>
 /// <param name="path">The path.</param>
 /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns>
 public static IImageProcessingContext Clear(this IImageProcessingContext source, IBrush brush, IPath path) =>
 source.Clear(source.GetShapeGraphicsOptions(), brush, path);
예제 #10
0
 /// <summary>
 /// Clones the image then proceeds to apply processors to it before takign the output of that process and filling the vector with the result.
 /// </summary>
 /// <param name="path">The target path to fill</param>
 /// <param name="innerProcessingOperations">the set of procssing operations to apply inside the path</param>
 /// <returns></returns>
 public static IImageProcessingContext ProcessInsideShape(this IImageProcessingContext context, IPath path, Action <IImageProcessingContext> innerProcessingOperations)
 {
     return(context.ApplyProcessor(new RecursiveImageProcessor(context.GetShapeGraphicsOptions(), path, innerProcessingOperations)));
 }