
'Declaration Public Class AutoTextOrientationCommand Inherits Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
public class AutoTextOrientationCommand : Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
public __gc class AutoTextOrientationCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
public ref class AutoTextOrientationCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
''' <summary> ''' Applies auto text orientation and saves the result to the specified file. ''' </summary> ''' <param name="sourceFile">Source file.</param> ''' <param name="resultFile">Result file.</param> Public Sub ApplyAutoTextOrientation(sourceFile As String, resultFile As String) Using image As New Vintasoft.Imaging.VintasoftImage(sourceFile) ' create deskew command Dim deskew As New Vintasoft.Imaging.ImageProcessing.Document.DeskewCommand() ' create auto text orientation command Dim autoTextOrientation As New Vintasoft.Imaging.ImageProcessing.Document.AutoTextOrientationCommand() Try ' apply deskew command deskew.ExecuteInPlace(image) ' apply auto text orientation command autoTextOrientation.ExecuteInPlace(image) Catch ex As Vintasoft.Imaging.ImageProcessing.ImageProcessingException ' show error message if problem occured System.Windows.Forms.MessageBox.Show(ex.Message) Return End Try ' save the result image to file image.Save(resultFile) End Using End Sub
/// <summary> /// Applies auto text orientation and saves the result to the specified file. /// </summary> /// <param name="sourceFile">Source file.</param> /// <param name="resultFile">Result file.</param> public void ApplyAutoTextOrientation(string sourceFile, string resultFile) { using (Vintasoft.Imaging.VintasoftImage image = new Vintasoft.Imaging.VintasoftImage(sourceFile)) { // create deskew command Vintasoft.Imaging.ImageProcessing.Document.DeskewCommand deskew = new Vintasoft.Imaging.ImageProcessing.Document.DeskewCommand(); // create auto text orientation command Vintasoft.Imaging.ImageProcessing.Document.AutoTextOrientationCommand autoTextOrientation = new Vintasoft.Imaging.ImageProcessing.Document.AutoTextOrientationCommand(); try { // apply deskew command deskew.ExecuteInPlace(image); // apply auto text orientation command autoTextOrientation.ExecuteInPlace(image); } catch (Vintasoft.Imaging.ImageProcessing.ImageProcessingException ex) { // show error message if problem occured System.Windows.Forms.MessageBox.Show(ex.Message); return; } // save the result image to file image.Save(resultFile); } }
System.Object
Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
Vintasoft.Imaging.ImageProcessing.Document.AutoTextOrientationCommand
Target Platforms: .NET 5; .NET Core 3.1; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5