Example #1
0
        /// <summary>
        /// Changes the saturation of the current image.
        /// </summary>
        /// <param name="percentage">
        /// The percentage by which to alter the images saturation.
        /// Any integer between -100 and 100.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        //public ImageFactory Saturation(int percentage)
        //{
        //    if (this.ShouldProcess)
        //    {
        //        // Sanitize the input.
        //        if (percentage > 100 || percentage < -100)
        //        {
        //            percentage = 0;
        //        }

        //        Saturation saturate = new Saturation { DynamicParameter = percentage };

        //        this.Image = saturate.ProcessImage(this);
        //    }

        //    return this;
        //}

        /// <summary>
        /// Adds a vignette image effect to the current image.
        /// </summary>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        //public ImageFactory Vignette()
        //{
        //    if (this.ShouldProcess)
        //    {
        //        Vignette vignette = new Vignette();

        //        this.Image = vignette.ProcessImage(this);
        //    }

        //    return this;
        //}

        /// <summary>
        /// Adds a text based watermark to the current image.
        /// </summary>
        /// <param name="textLayer">
        /// The <see cref="T:ImageProcessor.Imaging.TextLayer"/> containing the properties necessary to add
        /// the text based watermark to the image.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        public ImageFactory Watermark(TextLayer textLayer)
        {
            if (this.ShouldProcess)
            {
                Watermark watermark = new Watermark {
                    DynamicParameter = textLayer
                };

                this.Image = watermark.ProcessImage(this);
            }

            return(this);
        }
Example #2
0
        public string Post([FromBody] Watermark req)
        {
            var response = Watermark.ProcessImage(req);

            return(response);
        }