public class ImageStream extends 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.Image = ImageStream.fromFile("image.tiff"); ocr.Image = ImageStream.fromStream(memoryStream, imageStreamFormat); ocr.Image = ImageStream.fromUrl("http://www.someplace.com/images/logo.gif");
Modifier and Type | Method and Description |
---|---|
static IImageStream |
fromFile(String imageFile)
Creates instance of “IImageStream” from the specified file.
|
static IImageStream |
fromStream(InputStream stream,
int type)
Creates instance of “IImageStream” object from Stream, parameter "format" sets a data type.
|
static IImageStream |
fromUrl(String imageUrl)
Creates instance of “IImageStream” from the specified URL.
|
public static IImageStream fromFile(String imageFile)
Creates instance of “IImageStream” from the specified file. This will raise exception if the file not exists or the file format is not supported.
imageFile
- A string that contains the name of the file from which to create the IImageStream
.
OcrEngine ocr = new OcrEngine(); ocr.setImage(ImageStream.fromFile(@"image.tiff"));
IImageStream
object.OcrException
- Thrown when file not exists or format not supported.public static IImageStream fromStream(InputStream stream, int type)
Creates instance of “IImageStream” object from Stream, parameter "format" sets a data type.
stream
- The Stream
object with image data.type
- The ImageStreamFormat
object sets image format
OcrEngine ocr = new OcrEngine(); ocr.setImage(ImageStream.fromStream(stream, imageStreamFormat));
IImageStream
.public static IImageStream fromUrl(String imageUrl)
Creates instance of “IImageStream” from the specified URL. This will raise exception if the URL is invalid or the file format is not supported.
imageUrl
- A string that contains the name of the file from which to create the IImageStream
.
OcrEngine ocr = new OcrEngine(); ocr.setImage(ImageStream.fromUrl("http://www.someplace.com/images/logo.gif"));
IImageStream
object.OcrException
- Thrown when URL is invalid or format not supported.Copyright © 2017. All Rights Reserved.