예제 #1
0
        private void distortImage(IImageProcessingContext pc, string foreColor)
        {
            var degrees = _randomNumberProvider.NextNumber(1, 6);

            pc.Skew(degrees, degrees);
            pc.Vignette(Color.ParseHex(foreColor));
        }
예제 #2
0
 /// <summary>
 /// Applies a radial vignette effect to an image.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="color">The color to set as the vignette.</param>
 /// <param name="radiusX">The the x-radius.</param>
 /// <param name="radiusY">The the y-radius.</param>
 /// <param name="rectangle">
 /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
 /// </param>
 /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns>
 public static IImageProcessingContext Vignette(
     this IImageProcessingContext source,
     Color color,
     float radiusX,
     float radiusY,
     Rectangle rectangle) =>
 source.Vignette(new GraphicsOptions(), color, radiusX, radiusY, rectangle);
예제 #3
0
 protected override void Apply(IImageProcessingContext ctx, Rectangle rect) => ctx.Vignette(rect);
예제 #4
0
 protected override void Apply(IImageProcessingContext ctx, float radiusX, float radiusY) =>
 ctx.Vignette(radiusX, radiusY);
예제 #5
0
 protected override void Apply(IImageProcessingContext ctx, Color color) => ctx.Vignette(color);
예제 #6
0
 /// <summary>
 /// Applies a radial vignette effect to an image.
 /// </summary>
 /// <typeparam name="TPixel">The pixel format.</typeparam>
 /// <param name="source">The image this method extends.</param>
 /// <param name="color">The color to set as the vignette.</param>
 /// <param name="radiusX">The the x-radius.</param>
 /// <param name="radiusY">The the y-radius.</param>
 /// <param name="rectangle">
 /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
 /// </param>
 /// <returns>The <see cref="Image{TPixel}"/>.</returns>
 public static IImageProcessingContext <TPixel> Vignette <TPixel>(this IImageProcessingContext <TPixel> source, TPixel color, float radiusX, float radiusY, Rectangle rectangle)
     where TPixel : struct, IPixel <TPixel>
 => source.Vignette(color, radiusX, radiusY, rectangle, GraphicsOptions.Default);
예제 #7
0
 protected override void Apply <T>(IImageProcessingContext <T> ctx, T color) => ctx.Vignette(color);