Visual Basic (Declaration) | |
---|---|
<SerializableAttribute()> Public Class RasterImage |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
[SerializableAttribute()] public class RasterImage |
C++/CLI | |
---|---|
[SerializableAttribute()] public ref class RasterImage |
This example loads an image file from a disk file, and processes the image data before saving it back to disk.
Visual Basic | Copy Code |
---|---|
Public Sub RasterImageExample() |
C# | Copy Code |
---|---|
public void RasterImageExample() |
The RasterImage class is used to work with images defined by pixel data.
The RasterImage class contains contains methods and properties for dealing with images in memory. You can use this class to create images from scratch or load them from disk based files. Also, various other components of LEADTOOLS for .NET creates RasterImage objects from operations such as scanning and OCRing. Morever, the RasterImage class is the main LEADTOOLS object used when passing image data between different parts of the toolkit.
The RasterImage class lets you deal with individual rows or pixels of the image data. This class also contains methods and properties for the following:
Creating images Accessing the image data Adding regions to the image Setting/Changing the palette for an image Converting an image to a GDI+ Image Creating a GDI+ Graphics object from an image Painting an image
The RasterImage class implements the ISerializable interface and thus supports standard .NET serialization. For more information and examples regarding serialization of an RasterImage object, refer to RasterImage Serialization.
The RasterImage class also implements the IDisposable interface, it is recommended that you follow the standard .NET dispose pattern when using the RasterImage class. For more information, refer to the IDisposable interface documentation in MSDN, the IsDisposed property and the RasterImage.Disposed event.
The LEADTOOLS RasterImage class supports storing images in memory in the following bits per pixel: 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32, 38 and 64. A 16-bpp image may be color or grayscale. If you are working with a 16-bit grayscale image. Support for 8-bit and 12-bit grayscale images is also provided.
The data of a RasterImage object can be stored in memory as uncompressed, RLE compressed or super compressed. Support for super compressing bitmaps is available only in the Document/Medical Imaging editions.
The RasterImage object can also store its data in disk-based swap files when conventional memory is not enough.
The RasterImage object can hold multiple pages with different sizes. The AddPage, AddPages, InsertPage and InsertPages methods allows adding new pages to an existing RasterImage.
The RemovePageAt, RemovePages and RemoveAllPages methods allows removing existing pages from a RasterImage object.
The PageCount property holds the total number of pages in a RasterImage object while the Page property allows you to change the current active page.
The current active page (The page indicated by the Page property) is used by default when accessing the data of a RasterImage object unless otherwise indicated.
The RasterImage object also contains a region of interest value that can be used to limit the portion available to update when using the image processing command. The region can be set using a geometric shape such as AddRectangleToRegion and AddEllipseToRegion or with image data attributes such as AddColorToRegion and AddMaskToRegion.
System.Object
Leadtools.RasterImage
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family