Loads image from a byte array with the specified file format.
| ActiveX Edition | Plug-in Edition | Mac Edition |
|---|---|---|
| Since V6.0 | Since V6.0 | Since V6.4 |
ObjectName.LoadImageFromBytes(Uint32 bufferSize, Variant * buffer, long ImageType)
Uint32 bufferSize: Specifies the buffer size.
Variant * buffer: A byte array of the image data.
long ImageType: Specifies the file format.
True indicates success. False indicates failure.
Dynamic Web TWAIN supports the following types of image files:
| Allowed Values | ImageType |
| 0 | BMP |
| 1 | JPEG |
| 2 | TIFF |
| 3 | PNG |
| 4 |
The loaded image will be displayed in the Dynamic Web TWAIN.
When an error occurs and IfThrowException property is TRUE, an exception will be thrown.
When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.
Javascript Sample:
Twain.SelectedImagesCount = 2;
Twain.SelectedImageIndex(0) = 4;// add put_ or set_ prefix
Twain.SelectedImageIndex(1) = 3;
var size = Twain.GetSelectedImagesSize(2);
Array ary = new Array(size);
Twain.SaveSelectedImagesToBytes(size, ary);
Twain.LoadImageFromBytes(size, ary, 2);
VB Sample:
Dim ary as Variant Twain.SelectedImagesCount = 2 Twain.SelectedImageIndex[0] = 4 Twain.SelectedImageIndex[1] = 3 Dim size as long Set size = Twain.GetSelectedImagesSize(2) Redim ary(size) as byte Twain.SaveSelectedImagesToBytes(size, ary) Twain.LoadImageFromBytes(size, ary, 2);
TWAIN ActiveX |
TWAIN Plug-in |
TWAIN Control |
TWAIN SDK |
Scanner COM
Software Configuration Management |
Version Control |
Source Control
Copyright © 2012 Dynamsoft Corporation. All Rights Reserved.