public class ImageStream
extends java.lang.Object
This factory creates objects of “IImageStream” type. This has a set of static methods for creating objects from different input data.
OcrEngine ocr = new OcrEngine(); ocr.setImage(ImageStream.fromFile(@"image.tiff")); ocr.setImage(ImageStream.fromMemoryStream(memoryStream, imageStreamFormat));
Constructor and Description |
---|
ImageStream() |
Modifier and Type | Method and Description |
---|---|
static IImageStream |
fromFile(java.lang.String imageFile)
Creates instance of “IImageStream” from the specified file.
|
static IImageStream |
fromMemoryStream(byte[] memoryStream,
int type)
Creates instance of “IImageStream” object from MemoryStream, parameter "format" sets a data type.
|
static IImageStream |
fromMemoryStreamInternal(MemoryStream memoryStream,
int type)
Creates instance of “IImageStream” object from MemoryStream, parameter "format" sets a data type.
|
public static IImageStream fromFile(java.lang.String imageFile)
Creates instance of “IImageStream” from the specified file. This will raise exception if the file not exists or the file formats is not supported.
imageFile
- A string that contains the name of the file from which to create the IImageStream
.IImageStream
object.OcrException
- Thrown when file not exists or format not supported.public static IImageStream fromMemoryStream(byte[] memoryStream, int type)
Creates instance of “IImageStream” object from MemoryStream, parameter "format" sets a data type.
public static IImageStream fromMemoryStreamInternal(MemoryStream memoryStream, int type)
Creates instance of “IImageStream” object from MemoryStream, parameter "format" sets a data type.
memoryStream
- The MemoryStream
object with image data.type
- The ImageStreamFormat
object sets image format in memoryStreameam parameter.IImageStream
.