Esempio n. 1
0
        /// <summary>
        /// Sets the default shape processing options against the image processing context.
        /// </summary>
        /// <param name="context">The image processing context to store default against.</param>
        /// <param name="optionsBuilder">The action to update instance of the default options used.</param>
        /// <returns>The passed in <paramref name="context"/> to allow chaining.</returns>
        public static IImageProcessingContext SetShapeOptions(this IImageProcessingContext context, Action <ShapeOptions> optionsBuilder)
        {
            var cloned = context.GetShapeOptions().DeepClone();

            optionsBuilder(cloned);
            context.Properties[typeof(ShapeOptions)] = cloned;
            return(context);
        }
Esempio n. 2
0
 /// <summary>
 /// Gets the default shape processing options against the image processing context.
 /// </summary>
 /// <param name="context">The image processing context to retrieve defaults from.</param>
 /// <returns>The globaly configued default options.</returns>
 public static ShapeGraphicsOptions GetShapeGraphicsOptions(this IImageProcessingContext context)
 => new ShapeGraphicsOptions(context.GetGraphicsOptions(), context.GetShapeOptions());