Last active
September 11, 2019 12:14
-
-
Save samer199008/d315058b9d102db1308103c3aa4ae943 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/CSharp/ModifyingAndConvertingImages/Deskew.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Deskew | |
{ | |
public static void Run() | |
{ | |
string dataDir = RunExamples.GetDataDir_ModifyingAndConvertingImages(); | |
string fileName = "skewed.png"; | |
string output = "skewed.out.png"; | |
string inputFileName = Path.Combine(dataDir, fileName); | |
// Get rid of the skewed scan with default parameters | |
using (RasterImage image = (RasterImage)Image.Load(inputFileName)) | |
{ | |
image.NormalizeAngle(false /*do not resize*/, Color.LightGray /*background color*/); | |
image.Save(Path.Combine(dataDir, output)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment