ISIS Xpress 7 for .NET - User Guide > How To > How To Pass Image Data Between Different Accusoft Components |
Traditionally, transferring image data between Accusoft components has required passing the image data in a DIB format. But, beginning with the release of ImagXpress 11, we are adding new methods throughout our products which allow you to easily copy or transfer image data between different Accusoft objects with just a single method call.
Regardless of its product or component assembly, any Accusoft image class which supports easily sending its image data to another Accusoft object will implement two methods: CopyTo(object destination) and TransferTo(object destination). And any Accusoft image class which supports easily receiving this image data (that is, being the destination object) will be noted in its class documentation.
A CopyTo method makes a complete copy of the image data. When called, both the source and destination objects will contain their own separate copies of identical image data. A TransferTo method, on the other hand, completely transfers the image data from one object to another. When finished, the source object will no longer contain image data; the image will be owned by the destination object.
Within the ImagXpress suite of components, there are four classes which support sending their image data via CopyTo and TransferTo methods:
And within the ImagXpress suite of components, there is only one class which supports receiving image data: the ImagXpress ImageX class.
Other Accusoft products may contain additional classes which can send and receive image data.
Here's an example that scans an image with ISIS Xpress and then transfers the image data to ImagXpress for further processing before being saved.
C# Example |
Copy Code
|
---|---|
using Accusoft.ImagXpressSdk; using Accusoft.ISISXpressSdk; namespace ConsoleExample { class Program { static IsisXpress isis; static void Main(string[] args) { isis = new IsisXpress(); isis.Scanned += new IsisXpress.ScannedEventHandler(isis_Scanned); isis.Output.CreateFiles = false; isis.Output.CreateDib = true; isis.Scanner.Select(); isis.Scanner.ScanSingle(); } static void isis_Scanned(object sender, ScannedEventArgs e) { using (ImagXpress ix = new ImagXpress()) using (ImageX image = new ImageX(ix)) using (Processor processor = new Processor(ix)) { //Transfer the scanned image data from ISIS Xpress to ImagXpress isis.Output.TransferTo(image); //Process and save the image with ImagXpress processor.Image = image; processor.Negate(); image.Save("inverted-scan.bmp"); } } } } |
In the above example, we transfer the scanned image to an ImagXpress ImageX object named image. Once that is done, we can use any of the processing features of ImagXpress to manipulate the scanned image data. In this case we simply create a color negative of the image data and then save it to disk as "inverted-scan.bmp".