Skip to content

Instantly share code, notes, and snippets.

@samer199008
Last active September 11, 2019 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samer199008/d315058b9d102db1308103c3aa4ae943 to your computer and use it in GitHub Desktop.
Save samer199008/d315058b9d102db1308103c3aa4ae943 to your computer and use it in GitHub Desktop.
https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/CSharp/ModifyingAndConvertingImages/Deskew.cs
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