diff --git a/src/ImageProcessor/ImageFactory.cs b/src/ImageProcessor/ImageFactory.cs index 6ac5e542e..a4f132325 100644 --- a/src/ImageProcessor/ImageFactory.cs +++ b/src/ImageProcessor/ImageFactory.cs @@ -895,6 +895,23 @@ namespace ImageProcessor return this; } + /// + /// Rotates the image inside its area; keeps the area straight. + /// + /// The angle at which to rotate the image in degrees + /// The current instance of the class. + /// + public ImageFactory RotateInside(float degrees) + { + if (this.ShouldProcess) + { + RotateInside rotate = new RotateInside { DynamicParameter = degrees }; + this.CurrentImageFormat.ApplyProcessor(rotate.ProcessImage, this); + } + + return this; + } + /// /// Adds rounded corners to the current image. /// diff --git a/src/ImageProcessor/ImageProcessor.csproj b/src/ImageProcessor/ImageProcessor.csproj index 88d010e60..c5187d3ed 100644 --- a/src/ImageProcessor/ImageProcessor.csproj +++ b/src/ImageProcessor/ImageProcessor.csproj @@ -233,6 +233,7 @@ + diff --git a/src/ImageProcessor/Processors/RotateInside.cs b/src/ImageProcessor/Processors/RotateInside.cs new file mode 100644 index 000000000..919f846b4 --- /dev/null +++ b/src/ImageProcessor/Processors/RotateInside.cs @@ -0,0 +1,46 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) James South. +// Licensed under the Apache License, Version 2.0. +// +// +// Encapsulates methods to rotate an image. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace ImageProcessor.Processors +{ + using System; + using System.Collections.Generic; + using System.Drawing; + + /// + /// Encapsulates the methods to rotate the inside of an image + /// + public class RotateInside : IGraphicsProcessor + { + /// + /// Gets or sets the DynamicParameter. + /// + public dynamic DynamicParameter { get; set; } + + /// + /// Gets or sets any additional settings required by the processor. + /// + public Dictionary Settings { get; set; } + + /// + /// Processes the image. + /// + /// The current instance of the class containing + /// the image to process. + /// + /// The processed image from the current instance of the class. + /// + public Image ProcessImage(ImageFactory factory) + { + // TODO: Implement this method + throw new NotImplementedException(); + } + } +} \ No newline at end of file