Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, October 11, 2007 10:06:50 AM(UTC)

jctran  
jctran

Groups: Registered
Posts: 4


I got images coming in the fax servers that are up-side down. I would like to use Leadtools 15 to write a VB app that automatically turn them rightside up if they are upside down. Please email me a sample code if you have them. Thank you very much for your help.

Edited by moderator Friday, October 21, 2016 2:03:00 PM(UTC)  | Reason: Not specified

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, October 11, 2007 11:50:41 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Hello,

I sent you a reply to the email that you sent.  I'm just reposting it here so others can have a look at it.

The basic concept is, you load an image using the RasterCodecs class.  You add that loaded image to the RasterDocumentEngine object.  Then you call the AutoOrientPage() method, specifying the page you would like to auto orient.  Next, you export the oriented page to a RasterImage object.  Finally, you call the Save() method in the RasterCodecs to save it to the disk.

SAMPLE CODE FOLLOWS:

Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Document

Public Sub AutoOrientPageExample()
  ' Note that this is a sample key, which will not work in your toolkit
  ' Change it to the key that you were given.
  RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")

  ' We have to start the codecs engine before creating a new instance
  RasterCodecs.Startup()

  ' Create instance of the class.
  Dim rasterCodecs as RasterCodecs = new RasterCodecs()

  ' Create an instance of the document engine and start the engine.
  Dim rasterDocument As RasterDocumentEngine
  rasterDocument = RasterDocumentEngine.Instance
  rasterDocument.Startup()

  ' Adding a page here.
  Dim tempImage as RasterImage = codecs.Load("C:\faxpage.tif")
  rasterDocument.AddPage(tempImage, 0)

  Try
     rasterDocument.AutoOrientPage(0)
  Catch ex As Exception
     MessageBox.Show(ex.Message)
  End Try

  ' Export the page to a RasterImage object and save.
  Dim rotatedPage as RasterImage = rasterDocument.ExportPage(0)
  codecs.Save(rotatedPage, "C:\rotatedPage.tif", RasterImageFormat.TifLzw, 0)

  ' Shutdown the engines.
  RasterCodecs.Shutdown()
  rasterDocument.Shutdown()

End Sub
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.112 seconds.