LEADTOOLS OCR (Leadtools.Forms.Ocr assembly)

GetRasterImage() Method

Show in webframe







Gets the current image data of this page as a raster image.
Syntax
RasterImage GetRasterImage()
'Declaration
 
Overloads Function GetRasterImage() As RasterImage
'Usage
 
Dim instance As IOcrPage
Dim value As RasterImage
 
value = instance.GetRasterImage()
RasterImage GetRasterImage()
- (LTRasterImage*)getRasterImage;
public RasterImage getRasterImage()
function Leadtools.Forms.Ocr.IOcrPage.GetRasterImage()()
RasterImage^ GetRasterImage(); 

Return Value

A Leadtools.RasterImage object that represent the current image data of this page.
Remarks

This method is the equivalent of calling GetRasterImage(OcrPageType.Current). For more information on the various copies of raster images used by the OCR page, refer to OcrPageType.

Once you add a page to an OCR document, the image data used to create the page is copied and stored inside the OCR engine even if the original object used to create the page was a Leadtools.RasterImage object. To get a Leadtools.RasterImage that represents this page, use GetRasterImage.

The Leadtools.RasterImage object that this method returns contains a copy of the page image data. Any modifications you make to the Leadtools.RasterImage object will not affect the page. To update the page image data, you must call SetRasterImage. Since the Leadtools.RasterImage object is a copy, you must dispose it by calling its RasterImage.Dispose method once you are done using it.

Once you obtain a Leadtools.RasterImage object for this page, you can use it with other parts of LEADTOOLS, for example, you can set it in the Leadtools.WinForms.RasterImageViewer or Leadtools.WinForms.RasterPictureBox controls for viewing inside your Windows Forms-based application. You can also perform your own image processing on the page as follows:

// Flip the 2nd page added to the OCR document // Get the page (index is zero-based) IOcrPage page = ocrDocument.Pages[1]; // Get a RasterImage object that represents this page Leadtools.RasterImage image = page.GetRasterImage(); // Flip it vertically Leadtools.ImageProcessing.FlipCommand flip = new Leadtools.ImageProcessing.FlipCommand(); flip.Horizontal = false; flip.Run(image); // Set it back into the page page.SetRasterImage(image); // Dispose the image image.Dispose();

You can also get a Leadtools.RasterImage object representation of a page with the IOcrPageCollection.ExportPage methods.

The Leadtools.RasterImage object returned from this method will contain one page only. To get a multi-page Leadtools.RasterImage object containing the image data of all or a specific range of the pages added to the OCR document, you can either create a Leadtools.RasterImage from the first then loop through the pages of the document and add the returned Leadtools.RasterImage objects to the first object with the RasterImage.AddPage method. Or you can use the IOcrPageCollection.ExportPages methods.

Example
For an example, refer to IOcrPage.
Requirements

Target Platforms

See Also

Reference

IOcrPage Interface
IOcrPage Members
Overload List
SetRasterImage Method
IOcrPageCollection Interface
IOcrZoneCollection Interface
OcrZone Structure
Programming with Leadtools .NET OCR

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

GetRasterImage() requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features